| | |
| | | zIndex: undefined, |
| | | }, |
| | | mapCollection: undefined, |
| | | mapList: [ |
| | | { |
| | | name: "天地图", |
| | | sourceType: "tdmap", |
| | | tokne: "94a34772eb88317fcbf8428e10448561", |
| | | maximumLevel: 18, |
| | | id: 1, |
| | | isShow: true, |
| | | list: [ |
| | | { |
| | | name: "天地图地图", |
| | | image: require("../../assets/img/imageLayer/tdmap_map.jpg"), |
| | | urls: "http://t0.tianditu.com/vec_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=", |
| | | olUrls: 'http://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=' |
| | | }, |
| | | { |
| | | name: "天地图影像", |
| | | image: require("../../assets/img/imageLayer/tdmap_image.jpg"), |
| | | urls: "http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=", |
| | | olUrls: 'http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=' |
| | | }, |
| | | { |
| | | name: "天地图地形", |
| | | image: require("../../assets/img/imageLayer/tdmap_label.jpg"), |
| | | urls: "http://t0.tianditu.com/ter_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=ter&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=", |
| | | olUrls: 'http://t0.tianditu.gov.cn/DataServer?T=ter_w&x={x}&y={y}&l={z}&tk=' |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | name: "高德地图", |
| | | sourceType: "gdmap", |
| | | maximumLevel: 18, |
| | | id: 2, |
| | | isShow: true, |
| | | list: [ |
| | | { |
| | | name: "高德地图", |
| | | image: require("../../assets/img/imageLayer/gdmap_map.jpg"), |
| | | urls: "https://webst02.is.autonavi.com/appmaptile?style=7&x={x}&y={y}&z={z}", |
| | | }, |
| | | { |
| | | name: "高德影像", |
| | | image: require("../../assets/img/imageLayer/gdmap_image.jpg"), |
| | | urls: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}", |
| | | }, |
| | | mapList: [{ |
| | | name: "Cesium", |
| | | sourceType: "cesium", |
| | | tokne: "94a34772eb88317fcbf8428e10448561", |
| | | maximumLevel: 18, |
| | | id: 1, |
| | | isShow: true, |
| | | list: [{ |
| | | name: "Cesium影像", |
| | | image: require("../../assets/img/imageLayer/tdmap_image.jpg"), |
| | | urls: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}", |
| | | },], |
| | | }, |
| | | |
| | | ], |
| | | }, { |
| | | name: '本地服务', |
| | | sourceType: 'localmap', |
| | | maximumLevel: 18, |
| | | id: 3, |
| | | isShow: true, |
| | | list: [ |
| | | { |
| | | name: "地图", |
| | | image: require("../../assets/img/imageLayer/gdmap_map.jpg"), |
| | | urls: "http://{host}/LFData/2d/tiles/vec/{z}/{x}/{y}.png", |
| | | }, |
| | | { |
| | | name: "影像", |
| | | image: require("../../assets/img/imageLayer/gdmap_image.jpg"), |
| | | urls: "http://{host}/LFData/2d/tiles/img/{z}/{x}/{y}.png", |
| | | }, |
| | | // { |
| | | // name: "地形", |
| | | // image: require("../../assets/img/imageLayer/tdmap_label.jpg"), |
| | | // urls: "http://{host}/LFData/2d/tiles/ter/{z}/{x}/{y}.png", |
| | | // }, |
| | | { |
| | | name: "天地图", |
| | | sourceType: "tdmap", |
| | | tokne: "94a34772eb88317fcbf8428e10448561", |
| | | maximumLevel: 18, |
| | | id: 1, |
| | | isShow: true, |
| | | list: [ |
| | | { |
| | | name: "天地图地图", |
| | | image: require("../../assets/img/imageLayer/tdmap_map.jpg"), |
| | | urls: "http://t0.tianditu.com/vec_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=", |
| | | olUrls: 'http://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=' |
| | | }, |
| | | { |
| | | name: "天地图影像", |
| | | image: require("../../assets/img/imageLayer/tdmap_image.jpg"), |
| | | urls: "http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=", |
| | | olUrls: 'http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=' |
| | | }, |
| | | { |
| | | name: "天地图地形", |
| | | image: require("../../assets/img/imageLayer/tdmap_label.jpg"), |
| | | urls: "http://t0.tianditu.com/ter_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=ter&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=", |
| | | olUrls: 'http://t0.tianditu.gov.cn/DataServer?T=ter_w&x={x}&y={y}&l={z}&tk=' |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | name: "高德地图", |
| | | sourceType: "gdmap", |
| | | maximumLevel: 18, |
| | | id: 2, |
| | | isShow: true, |
| | | list: [ |
| | | { |
| | | name: "高德地图", |
| | | image: require("../../assets/img/imageLayer/gdmap_map.jpg"), |
| | | urls: "https://webst02.is.autonavi.com/appmaptile?style=7&x={x}&y={y}&z={z}", |
| | | }, |
| | | { |
| | | name: "高德影像", |
| | | image: require("../../assets/img/imageLayer/gdmap_image.jpg"), |
| | | urls: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}", |
| | | }, |
| | | |
| | | ], |
| | | } |
| | | ], |
| | | }, { |
| | | name: '本地服务', |
| | | sourceType: 'localmap', |
| | | maximumLevel: 22, |
| | | id: 3, |
| | | isShow: true, |
| | | list: [ |
| | | { |
| | | name: "地图", |
| | | image: require("../../assets/img/imageLayer/gdmap_map.jpg"), |
| | | urls: "http://{host}/LFData/2d/tiles/vec/{z}/{x}/{y}.png", |
| | | }, |
| | | { |
| | | name: "影像", |
| | | image: require("../../assets/img/imageLayer/gdmap_image.jpg"), |
| | | urls: "http://{host}/LFData/2d/tiles/img/{z}/{x}/{y}.png", |
| | | }, |
| | | { |
| | | name: "地形", |
| | | image: require("../../assets/img/imageLayer/dixing.png"), |
| | | urls: "http://{host}/LFData/2d/tiles/ter/{z}/{x}/{y}.png", |
| | | }, |
| | | { |
| | | name: "1:20万区域地质图", |
| | | image: require("../../assets/img/imageLayer/25dizhi.png"), |
| | | urls: "http://{host}/LFData/2d/tiles/20w_qydz/{z}/{x}/{y}.png", |
| | | }, |
| | | ], |
| | | } |
| | | |
| | | ], |
| | | }; |
| | |
| | | open() { |
| | | this.close(true); |
| | | this.$refs.pop.open(); |
| | | |
| | | }, |
| | | changeToken(token) { |
| | | this.mapCollection.tokne = token; |
| | |
| | | window.BaseMapLayer |
| | | ); |
| | | window.map.removeLayer(window.olBaseMapLayer); |
| | | if (!is_production) { |
| | | if (window.vectorLayer) { |
| | | window.map.removeLayer(window.vectorLayer); |
| | | } |
| | | } |
| | | }, |
| | | addImageLayer(map, mapCollection) { |
| | | |
| | |
| | | this.removeImageLayer(); |
| | | |
| | | this.mapCollection = mapCollection; |
| | | if (mapCollection.sourceType === "cesium") { |
| | | window.olBaseMapLayer = new TileLayer({ |
| | | title: "高德地图", |
| | | source: new XYZ({ |
| | | url: map.urls, |
| | | wrapX: false |
| | | }), |
| | | zIndex: -1 |
| | | }); |
| | | window.map.addLayer(window.olBaseMapLayer); |
| | | return; |
| | | } else if (mapCollection.sourceType === "tdmap") { |
| | | |
| | | if (mapCollection.sourceType === "tdmap") { |
| | | var tokne = mapCollection.tokne; |
| | | //添加天地图影像 |
| | | |
| | |
| | | format: "image/jpeg", |
| | | tileMatrixSetID: "GoogleMapsCompatible", |
| | | })) |
| | | |
| | | window.olBaseMapLayer = new TileLayer({ |
| | | title: "高德地图", |
| | | source: new XYZ({ |
| | |
| | | window.BaseMapLayer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: map.urls, |
| | | maximumLevel: this.data.maximumLevel, |
| | | maximumLevel: 22, |
| | | }) |
| | | ); |
| | | |
| | |
| | | window.BaseMapLayer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: ulr, |
| | | maximumLevel: this.data.maximumLevel, |
| | | maximumLevel: 22, |
| | | }) |
| | | ); |
| | | |
| | |
| | | window.map.addLayer(window.olBaseMapLayer); |
| | | } |
| | | Viewer.imageryLayers.lowerToBottom(window.BaseMapLayer);//将图层移到最底层 |
| | | Viewer.imageryLayers.raise(window.BaseMapLayer);//将图层移到最底层 |
| | | |
| | | Viewer.imageryLayers.raise(window.BaseMapLayer);//将图层上移一层 |
| | | if (is_production) { |
| | | Viewer.imageryLayers.raise(window.BaseMapLayer);//将图层上移一层 |
| | | } |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 添加数据 |
| | | addData() { |
| | | if (this.data.urls && this.data.sourceType) { |