I want to set a standard view / source location for a cesium application.
I do not just want to fly to a place once; I want the location to be set as the default / home - so that it can be used elsewhere in the application. in HomeButton Widget.
I tried setting Camera.DEFAULT_VIEW_RECTANGLE (docs here) as follows:
var extent = Cesium.Rectangle.fromDegrees(117.940573,-29.808406,118.313421,-29.468825); viewer.camera.DEFAULT_VIEW_RECTANGLE = extent;
But that does not work.
For completeness, here's how I initialize the application:
var viewer = new Cesium.Viewer('cesiumContainer', { terrainProvider : new Cesium.CesiumTerrainProvider({ url : '//cesiumjs.org/stk-terrain/tilesets/world/tiles' }), mapProjection : new Cesium.WebMercatorProjection(), timeline: false, animation: false, });
Any suggestions? If any further information is needed, please let me know.
source share