| | |
| | | appConfig: null, |
| | | mapDivId: '', |
| | | map: null, |
| | | baseLayer: null, |
| | | |
| | | constructor: function ( /*Object*/ options, mapDivId) { |
| | | this.appConfig = options.appConfig; |
| | |
| | | |
| | | _createMap: function (mode, appConfig) { |
| | | // define(["../libs/Cesium1.68/CesiumNavigation.umd "], function () { }); |
| | | |
| | | Cesium.Ion.defaultAccessToken = appConfig.cesiumToken; |
| | | //加载底图和地形配置 |
| | | appConfig.map.mapOptions["imageryProviderViewModels"] = this._getImageryProviderArr(appConfig); |
| | |
| | | //创建地图 |
| | | var dcViewer = new DC.Viewer(this.mapDivId, appConfig.map.mapOptions); |
| | | this.map = dcViewer.delegate; |
| | | this.baseLayer = "nihao"; |
| | | // this.map.extend(Cesium.viewerDragDropMixin); |
| | | this.map.scene.globe.depthTestAgainstTerrain = false; |
| | | this.map.scene.logarithmicDepthBuffer = false; |
| | | this.map.scene.globe.baseColor = Cesium.Color.WHITESMOKE ; |
| | | this.map.scene.globe.baseColor = Cesium.Color.BLACK; |
| | | window.viewer = this.map; |
| | | window.dcViewer = dcViewer; |
| | | var imageryLayers = this.map.imageryLayers; |
| | |
| | | this.map.baseLayerPicker.viewModel.selectedTerrain = this.map.baseLayerPicker.viewModel.terrainProviderViewModels[2]; |
| | | $(".cesium-baseLayerPicker-sectionTitle").eq(0).html("底图"); |
| | | $(".cesium-baseLayerPicker-sectionTitle").eq(1).html("地形"); |
| | | |
| | | |
| | | //对外暴露的公共接口 |
| | | topic.subscribe("gis/map/setCenter", lang.hitch(this, this.centerAt)); |
| | |
| | | 'http://cache1.arcgisonline.cn/arcgis/rest/services/SimpleFeature/ChinaBoundaryLine/MapServer' |
| | | }) |
| | | } |
| | | |
| | | else if (layerConfig.type == "mapbox") { |
| | | layer = new Cesium.MapboxImageryProvider({ |
| | | mapId: 'mapbox.country-boundaries-v1', |