cesium自定义二三维切换

  1. 实现源码如下:
//viewType:视图类型
function setViewType (viewType) {
    var scene = this.viewer.scene;
    switch (viewType) {
        case "三维视图":
            scene.morphTo3D(0);
            $(".cesium-sceneModePicker-wrapper").hide();
            $(".cesium-sceneModePicker-wrapper").toggle(50);
            break;
        case "二维视图":
            scene.morphTo2D(0);
            $(".cesium-sceneModePicker-wrapper").hide();
            $(".cesium-sceneModePicker-wrapper").toggle(50);
            break;
        case "哥伦布视图":
            scene.morphToColumbusView(0);
            $(".cesium-sceneModePicker-wrapper").hide();
            $(".cesium-sceneModePicker-wrapper").toggle(50);
            break;
        default:
            break;
    }
}

你可能感兴趣的:(Cesium三维地图,前端,gis)