|
@@ -126,7 +126,6 @@
|
|
|
class="left-panel"
|
|
|
v-if="showQuery"
|
|
|
>
|
|
|
- <!-- <div class="back-icon" @click="back"></div> -->
|
|
|
<div class="left-panel-content">
|
|
|
<div v-for="(item, index) in hzData" :key="index">
|
|
|
<div class="title" @click="resetAnswer(index)">
|
|
@@ -475,6 +474,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.mapExtend();
|
|
|
this.$nextTick(() => {
|
|
|
this.activeIndex = 0;
|
|
|
this.initMap();
|
|
@@ -565,6 +565,18 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ mapExtend() {
|
|
|
+ // 18级的地图
|
|
|
+ L.TileLayer.MyTileLayer2 = L.TileLayer.extend({
|
|
|
+ getTileUrl: function (coords) {
|
|
|
+ return L.Util.template(this._url, {
|
|
|
+ x: coords.x,
|
|
|
+ y: coords.y,
|
|
|
+ z: coords.z - 1,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
addGdLayer(dklist) {
|
|
|
if (this.geoLayer) {
|
|
|
this.map.removeLayer(this.geoLayer);
|
|
@@ -779,8 +791,7 @@ export default {
|
|
|
opacity: 0.8,
|
|
|
f: "json",
|
|
|
});
|
|
|
- }
|
|
|
- if (item.type == "geoserver") {
|
|
|
+ } else if (item.type == "geoserver") {
|
|
|
item.layer = L.tileLayer.wms(item.url, {
|
|
|
// 链接要改对应的
|
|
|
layers: item.layername,
|
|
@@ -788,22 +799,30 @@ export default {
|
|
|
layerID: Math.random(),
|
|
|
transparent: true,
|
|
|
});
|
|
|
- item.layer.setZIndex(100);
|
|
|
- }
|
|
|
- if (item.type == "wmts") {
|
|
|
+ item.layer.setZIndex(item.zindex);
|
|
|
+ } else if (item.type == "wmts") {
|
|
|
item.layer = getWmtsLayer(item);
|
|
|
- item.layer.setZIndex(100);
|
|
|
+ item.layer.setZIndex(item.zindex);
|
|
|
+ } else if (item.type == "tile2") {
|
|
|
+ item.layer = new L.TileLayer.MyTileLayer2(
|
|
|
+ item.url + "/tile/{z}/{y}/{x}"
|
|
|
+ );
|
|
|
+ item.layer.setZIndex(item.zindex);
|
|
|
}
|
|
|
- this.map.addLayer(item.layer);
|
|
|
- } else {
|
|
|
- this.map.addLayer(item.layer);
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.map.addLayer(item.layer);
|
|
|
} else {
|
|
|
if (item.layer != undefined || item.layer != null) {
|
|
|
this.map.removeLayer(item.layer);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ customTileUrl(coords) {
|
|
|
+ console.log("coords:" + coords);
|
|
|
+ var s = this.options.subdomains,
|
|
|
+ i = Math.abs(coords.x + coords.y) % s.length;
|
|
|
+ return `https://${s[i]}.example.com/tiles/${coords.z}/${coords.x}/${coords.y}.png`;
|
|
|
+ },
|
|
|
initMap() {
|
|
|
let CRS_4490 = new Proj.CRS(
|
|
|
"EPSG:4490",
|
|
@@ -836,43 +855,8 @@ export default {
|
|
|
crs: CRS_4490,
|
|
|
attributionControl: false, //去掉右下角的logo
|
|
|
});
|
|
|
- var tk = window.ApplicationConfig.tk;
|
|
|
- var tk = "6dfd31e3b55a8466f34997aee5551a9c";
|
|
|
- // 添加天地图底图
|
|
|
- //底图
|
|
|
- // const image = L.tileLayer(
|
|
|
- // "http://t{s}.tianditu.gov.cn/img_w/wmts?tk=" +
|
|
|
- // tk +
|
|
|
- // "&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}",
|
|
|
- // {
|
|
|
- // subdomains: [0, 1, 2, 3, 4, 5, 6, 7],
|
|
|
- // zIndex: 1,
|
|
|
- // }
|
|
|
- // );
|
|
|
- // this.map.addLayer(image);
|
|
|
- // const dx = L.tileLayer(
|
|
|
- // "https://t{s}.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=" +
|
|
|
- // tk,
|
|
|
- // {
|
|
|
- // subdomains: [0, 1, 2, 3, 4, 5, 6, 7],
|
|
|
- // transparent: true,
|
|
|
- // zIndex: 2,
|
|
|
- // }
|
|
|
- // );
|
|
|
- // this.map.addLayer(dx);
|
|
|
-
|
|
|
- // //注记
|
|
|
- // const cia = L.tileLayer(
|
|
|
- // "http://t{s}.tianditu.gov.cn/cia_w/wmts?tk=" +
|
|
|
- // tk +
|
|
|
- // "&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}",
|
|
|
- // {
|
|
|
- // subdomains: [0, 1, 2, 3, 4, 5, 6, 7],
|
|
|
- // transparent: true,
|
|
|
- // zIndex: 3,
|
|
|
- // }
|
|
|
- // );
|
|
|
- // this.map.addLayer(cia);
|
|
|
+ // var tk = window.ApplicationConfig.tk;
|
|
|
+ // var tk = "6dfd31e3b55a8466f34997aee5551a9c";
|
|
|
|
|
|
//默认加载所有选中图层
|
|
|
this.layers.forEach((layerGroup) => {
|
|
@@ -880,7 +864,6 @@ export default {
|
|
|
this.switchMapLayer(oneLayer);
|
|
|
});
|
|
|
});
|
|
|
- // var gd = this.layers[0].layers[0]
|
|
|
},
|
|
|
//属性识别
|
|
|
mapClick(e) {
|
|
@@ -1055,7 +1038,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
let queryGeometryUrl = window.ApplicationConfig.queryGeometryUrl;
|
|
|
- let that =this;
|
|
|
+ let that = this;
|
|
|
axios
|
|
|
.get(queryGeometryUrl, { params: { id: item.objectid } })
|
|
|
.then((data) => {
|