Skip to content

Commit

Permalink
added cartesian defined control, changes.md updated
Browse files Browse the repository at this point in the history
  • Loading branch information
esraerik committed Aug 17, 2017
1 parent ecfd3cb commit 045be72
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Apps/Sandcastle/gallery/3D Tiles Interactivity.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
'use strict';
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer');

var viewModel = {
rightClickAction: 'annotate',
middleClickAction: 'hide'
Expand Down Expand Up @@ -112,18 +111,20 @@
function annotate(movement, feature) {
if (scene.pickPositionSupported) {
var cartesian = scene.pickPosition(movement.position);
var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
var height = cartographic.height.toFixed(2) + ' m';

annotations.add({
position : cartesian,
text : height,
showBackground : true,
font : '14px monospace',
horizontalOrigin : Cesium.HorizontalOrigin.LEFT,
verticalOrigin : Cesium.VerticalOrigin.BOTTOM,
disableDepthTestDistance : Number.POSITIVE_INFINITY
});
if(Cesium.defined(cartesian)){
var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
var height = cartographic.height.toFixed(2) + ' m';

annotations.add({
position : cartesian,
text : height,
showBackground : true,
font : '14px monospace',
horizontalOrigin : Cesium.HorizontalOrigin.LEFT,
verticalOrigin : Cesium.VerticalOrigin.BOTTOM,
disableDepthTestDistance : Number.POSITIVE_INFINITY
});
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Change Log
==========
### 1.36 - 2017-08-17

* Breaking changes
* `3D Tiles Interactivity` added check if cartesian is defined before continuing

### 1.36 - 2017-08-01

Expand Down

0 comments on commit 045be72

Please sign in to comment.