如何在默认视图中设置音高(Cesium 1.35)

时间:2017-07-31 15:31:40

标签: javascript cesium

我试图为HomeBotton Widget设置默认音高。

  var home = Cesium.Rectangle.fromDegrees(11.34176,45.47452,17.60577,49.41534);
  var heading = 0.0;
  var pitch = Cesium.Math.toRadians(-45.0);
  var range = 0.0;
  Cesium.Camera.DEFAULT_VIEW_RECTANGLE = home;
  Cesium.Camera.DEFAULT_OFFSET =  Cesium.HeadingPitchRange(heading, pitch, range);

  var geeMetadata = new Cesium.GoogleEarthEnterpriseMetadata({
    url : 'http://openg.kartenwerkstatt.at/Austria3DSmall'
  });

  var viewer = new Cesium.Viewer('cesiumContainer', {
    imageryProvider : new Cesium.GoogleEarthEnterpriseImageryProvider({
        metadata : geeMetadata
    }),
    terrainProvider : new Cesium.CesiumTerrainProvider({
        url : '//assets.agi.com/stk-terrain/world'
    }),
    vrButton: true,
    animation: false,
    baseLayerPicker : false,
    homeButton: true,
    infoBox: true,
    geocoder: true,
    sceneModePicker: false,
    selectionIndicator: false,
    timeline: false,
    sceneModePicker: false,
    navigationHelpButton: true,

  });

使用Cesium.Camera.DEFAULT_VIEW_RECTANGLE设置默认视图可以正常工作。但我没有设法弄清楚Cesium.Camera.DEFAULT_OFFSET应该如何工作。

因此,我的Cesium地图最终看起来有点沉闷Cesium without pitch,而它看起来很像Cesium with Pitch

0 个答案:

没有答案