Skip to content

Commit

Permalink
Use toDegrees function from OpenLayers
Browse files Browse the repository at this point in the history
  • Loading branch information
fredj committed May 27, 2019
1 parent 549a4a2 commit ba321a5
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/olcs/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ngeoMiscDebounce from 'ngeo/misc/debounce.js';
import ngeoStatemanagerLocation from 'ngeo/statemanager/Location.js';
import {Permalink3dParam} from 'ngeo/olcs/constants.js';
import ngeoStatemanagerService from 'ngeo/statemanager/Service.js';
import {toDegrees} from 'ol/math.js';

/**
* @hidden
Expand Down Expand Up @@ -112,15 +113,11 @@ export const OlcsService = class {
const position = camera.positionCartographic;
this.ngeoStateManager_.updateState({
[Permalink3dParam.ENABLED]: true,
// @ts-ignore: Cesium
[Permalink3dParam.LON]: Cesium.Math.toDegrees(position.longitude).toFixed(5),
// @ts-ignore: Cesium
[Permalink3dParam.LAT]: Cesium.Math.toDegrees(position.latitude).toFixed(5),
[Permalink3dParam.LON]: toDegrees(position.longitude).toFixed(5),
[Permalink3dParam.LAT]: toDegrees(position.latitude).toFixed(5),
[Permalink3dParam.ELEVATION]: position.height.toFixed(0),
// @ts-ignore: Cesium
[Permalink3dParam.HEADING]: Cesium.Math.toDegrees(camera.heading).toFixed(3),
// @ts-ignore: Cesium
[Permalink3dParam.PITCH]: Cesium.Math.toDegrees(camera.pitch).toFixed(3)
[Permalink3dParam.HEADING]: toDegrees(camera.heading).toFixed(3),
[Permalink3dParam.PITCH]: toDegrees(camera.pitch).toFixed(3)
});
}, 1000, true));

Expand Down

0 comments on commit ba321a5

Please sign in to comment.