|
@@ -58,7 +58,8 @@ export default {
|
|
|
latLngGroup: [],
|
|
|
isEditableLayers: false, //绘图控件
|
|
|
drawControl: null, //绘图控件
|
|
|
- deckglLayer: null //图层Layer
|
|
|
+ deckglLayer: null, //图层Layer
|
|
|
+ deckglLayerList: [] //图层Layer(数组)
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -128,7 +129,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.initMap()
|
|
|
+ this.initMap()
|
|
|
//添加画图的提示信息
|
|
|
window.L.drawLocal.draw.toolbar = {
|
|
|
actions: {
|
|
@@ -783,7 +784,7 @@ export default {
|
|
|
},
|
|
|
dropLocation: function(lat, lng) { //落点定位
|
|
|
|
|
|
- this.map.flyTo([lat, lng], 14,{duration:2})
|
|
|
+ this.map.flyTo([lat, lng], 14, { duration: 2 })
|
|
|
|
|
|
// this.controlLevel(12)
|
|
|
// setTimeout(() => {
|
|
@@ -802,6 +803,20 @@ export default {
|
|
|
this.deckglLayer = window.L.supermap.tiledMapLayer(url, {})
|
|
|
this.map.addLayer(this.deckglLayer)
|
|
|
},
|
|
|
+ layerSwitchingList: function(urlList) { //图层切换数组 urlList 图层地址(数组)
|
|
|
+ if (this.deckglLayerList != null && this.deckglLayerList.length > 0) {
|
|
|
+ for (let i = 0; i < this.deckglLayerList.length; i++) {
|
|
|
+ this.deckglLayerList[i].remove()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (urlList != null && urlList.length > 0) {
|
|
|
+ for (let i = 0; i < urlList.length; i++) {
|
|
|
+ this.deckglLayer = window.L.supermap.tiledMapLayer(urlList[i], {})
|
|
|
+ this.deckglLayerList.push(this.deckglLayer)
|
|
|
+ this.map.addLayer(this.deckglLayer)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
/** ----------------------------------动态绘制开始------------------------------------- */
|
|
|
clearLayers: function() {
|
|
|
this.plottingLayer.removeAllFeatures()
|