var viewer = new Cesium.Viewer('cesiumContainer', {
navigationHelpButton: false,
navigationInstructionsInitiallyVisible: false,
baseLayerPicker: false,
geocoder: false,
timeline: false,
animation: false,
sceneMode: Cesium.SceneMode.SCENE2D,
baseLayerPicker: false,
imageryProvider: provider
});
var heading = Cesium.Math.toRadians(90);
var pitch = Cesium.Math.toRadians(-30);
var height = 10000;
if (viewer.dataSources.length > 0) {
//loop through datasources to find entities with the selected object's id.
for (var x=0;x<viewer.dataSources.length;x++) {
var matchingEntity = viewer.dataSources.get(x).entities.getById(objectId);
if (matchingEntity != undefined) {
viewer.flyTo(matchingEntity, new Cesium.HeadingPitchRange(heading, pitch, height)).then(function(result){
if (result) {
viewer.selectedEntity = matchingEntity;
}
});
}
}
}
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var viewer = new Cesium.Viewer('cesiumContainer');
var redRectangle = viewer.entities.add({
rectangle : {
coordinates : Cesium.Rectangle.fromDegrees(-110.0, 20.0, -80.0, 25.0),
material : Cesium.Color.RED.withAlpha(0.5),
outline : true,
outlineColor : Cesium.Color.RED
}
});
var czml = [{"id":"document", "version":"1.0"},{"id":"7056","name":"BEAXM6NLHF","point":{"color":{"rgba":[255,0,255,122]},"outlineWidth":1,"pixelSize":10,"show":true},"position":{"cartographicDegrees":[-93.5783,40.0997,0.0]}}];
var czmlDataSource = new Cesium.CzmlDataSource("testCzml");
viewer.dataSources.add(czmlDataSource);
czmlDataSource.load(czml, 'Test CZML');
/*
//45 degree counter-clockwise rotation from, 30 degree pitch looking down, 4000000 range.
//Omit range to use the calculated default.
viewer.zoomTo(redRectangle,
new Cesium.HeadingPitchRange(Cesium.Math.toRadians(45),
Cesium.Math.toRadians(-30),
4000000));
*/
viewer.flyTo(czmlDataSource.entities.getById(7056), {
offset : new Cesium.HeadingPitchRange(Cesium.Math.toRadians(45),
Cesium.Math.toRadians(-30),
4000000)
});