Using cesium it is possible to pan the 2D map having Asia as the center?
2 Answers
solved the problem by using cesium 1.34
And the following codes
var target = new Cesium.Cartesian3.fromDegrees(103.85195, 1.290270, 35000000);
viewer.camera.setView( { destination : target,
orientation: {
heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
pitch : Cesium.Math.toRadians(-90), // default value (looking down)
roll : 0.0 // default value
}});
Give this a try:
Cesium.Camera.DEFAULT_VIEW_RECTANGLE = Cesium.Rectangle.fromDegrees(0, -89, 170, 89);
Cesium.Camera.DEFAULT_VIEW_FACTOR = 1.1;
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.scene.morphTo2D(0);
Note the fromDegrees
parameters are: West, South, East, North.
Also note this sets up the default (home) view this way. If you wanted to pan the camera here at runtime, there are other ways to do this, see the Camera Demo.