| | |
| | | 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; |
| | |
| | | window.dcViewer = dcViewer; |
| | | var imageryLayers = this.map.imageryLayers; |
| | | imageryLayers.removeAll(); |
| | | |
| | | |
| | | var yinyan = new Cesium.WebMapTileServiceImageryProvider({ |
| | | "label": "天地图影像", |
| | | "type": "wmts", |
| | | "url": "http://t0.tianditu.gov.cn/img_w/wmts?tk=e9533f5acb2ac470b07f406a4d24b4f0", |
| | | "layer": "img", |
| | | "style": "default", |
| | | "format": "tiles", |
| | | "tileMatrixSetID": "w", |
| | | "maximumLevel": 17 |
| | | }); |
| | | dcViewer.hawkeyeMap.enable = true |
| | | dcViewer.hawkeyeMap.addBaseLayer( |
| | | yinyan |
| | | ) |
| | | |
| | | // // 罗盘 |
| | | // this.map.extend(Cesium.viewerCesiumNavigationMixin); |
| | |
| | | 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)); |