Skip to content

Commit

Permalink
fixed bearing result for leaflet
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 committed Mar 14, 2017
1 parent b694b05 commit 80f54f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web/client/components/map/leaflet/MeasurementSupport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ const MeasurementSupport = React.createClass({
} else if (bearingMarkers.length === 2) {
coords2 = [bearingMarkers[1].getLatLng().lng, bearingMarkers[1].getLatLng().lat];
}
// in order to align the results between leaflet and openlayers the coords are repojected only for leaflet
coords1 = CoordinatesUtils.reproject(coords1, 'EPSG:4326', this.props.projection);
coords2 = CoordinatesUtils.reproject(coords2, 'EPSG:4326', this.props.projection);
// calculate the azimuth as base for bearing information
bearing = CoordinatesUtils.calculateAzimuth(coords1, coords2, this.props.projection);
}
Expand Down

0 comments on commit 80f54f6

Please sign in to comment.