|
|
|
@ -275,10 +275,8 @@ export default { |
|
|
|
this.setStartScale(n); |
|
|
|
}, |
|
|
|
level(n, v) { |
|
|
|
console.log("level", n); |
|
|
|
}, |
|
|
|
peopleType(n, v) { |
|
|
|
console.log("peopleType", n); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
@ -288,7 +286,6 @@ export default { |
|
|
|
securityJsCode: "92ea2c965c6cf1ba7ee3a8fe01449ef2", |
|
|
|
}; |
|
|
|
const scale = this.$store.state.chooseArea.realScale; |
|
|
|
// console.log(scale); |
|
|
|
if (scale) { |
|
|
|
this.setStartScale(scale); |
|
|
|
} |
|
|
|
@ -346,16 +343,12 @@ export default { |
|
|
|
this.iniMapBase2(scene); |
|
|
|
} |
|
|
|
this.iniMapGrid(scene); |
|
|
|
// this.iniMapDot(scene); |
|
|
|
// this.iniMapDot2(scene); |
|
|
|
// await nextTick(0); |
|
|
|
this.zoomInABit(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 初始化底图 |
|
|
|
iniMapBase(scene) { |
|
|
|
// console.log("-----------------iniMapBase"); |
|
|
|
// 底图服务 |
|
|
|
const baseLayer = new RasterLayer({ |
|
|
|
zIndex: 1, |
|
|
|
@ -398,7 +391,6 @@ export default { |
|
|
|
|
|
|
|
// 初始化底图 天地图山东政务网瓦片 |
|
|
|
iniMapBase2(scene) { |
|
|
|
// console.log("-----------------iniMapBase"); |
|
|
|
// 底图服务 |
|
|
|
const baseLayer = new RasterLayer({ |
|
|
|
zIndex: 1, |
|
|
|
@ -425,7 +417,6 @@ export default { |
|
|
|
styleConfig = lightStyle; |
|
|
|
} |
|
|
|
|
|
|
|
// console.log("地图初始化数据", polygonData); |
|
|
|
// 画区域面积 |
|
|
|
polygonLayer = new PolygonLayer({ |
|
|
|
autoFit: true, |
|
|
|
@ -574,7 +565,6 @@ export default { |
|
|
|
this.$emit("clickAgency", e.feature.properties); |
|
|
|
}); |
|
|
|
posLayer.on("click", (e) => { |
|
|
|
console.log(e); |
|
|
|
}); |
|
|
|
}, |
|
|
|
clearMarkert() { |
|
|
|
@ -632,7 +622,6 @@ export default { |
|
|
|
}); |
|
|
|
|
|
|
|
dotBgLayer.on("mousemove", (e) => { |
|
|
|
// console.log(e); |
|
|
|
if (e.feature.properties.content) { |
|
|
|
const popup = new Popup({ |
|
|
|
offsets: [0, -0], |
|
|
|
@ -671,7 +660,6 @@ export default { |
|
|
|
}); |
|
|
|
|
|
|
|
dotLayer2.on("mousemove", (e) => { |
|
|
|
// console.log(e); |
|
|
|
if (e.feature.properties.content) { |
|
|
|
const popup = new Popup({ |
|
|
|
offsets: [0, -0], |
|
|
|
@ -760,7 +748,6 @@ export default { |
|
|
|
points.push([x, y]); |
|
|
|
} |
|
|
|
} |
|
|
|
console.log("points=======", points); |
|
|
|
return points; |
|
|
|
} |
|
|
|
|
|
|
|
@ -789,7 +776,6 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
if (searchBgLayer) { |
|
|
|
console.log("searchBgLayer已经存在了", searchBgLayer); |
|
|
|
searchBgLayer.setData(sourceData); |
|
|
|
} else { |
|
|
|
searchBgLayer = new PolygonLayer({ |
|
|
|
@ -817,7 +803,6 @@ export default { |
|
|
|
name: "pointMarker", |
|
|
|
}); |
|
|
|
for (let i in data) { |
|
|
|
// console.log(data[i].longitude * 1, data[i].latitude * 1); |
|
|
|
var el = document.createElement("div"); |
|
|
|
el.className = peopleType === "building" ? "label-pointLd-class" : "label-point-class"; |
|
|
|
el.classList.add(data[i].type); |
|
|
|
@ -871,7 +856,6 @@ export default { |
|
|
|
numMarker = new MarkerLayer({ |
|
|
|
name: "numMarker", |
|
|
|
}); |
|
|
|
console.log("data:", data); |
|
|
|
for (let i in data) { |
|
|
|
var el = document.createElement("label"); |
|
|
|
el.className = "label-num-class"; |
|
|
|
@ -886,40 +870,6 @@ export default { |
|
|
|
scene.addMarkerLayer(numMarker); |
|
|
|
}, |
|
|
|
|
|
|
|
/* setNumpoint(data) { |
|
|
|
this.clearMarkert(); |
|
|
|
numPointMarker = new MarkerLayer({ |
|
|
|
name: "numpoinMarker", |
|
|
|
}); |
|
|
|
for (let i in data) { |
|
|
|
for (let j in data[i].data) { |
|
|
|
if (data[i].data[j].num > 0) { |
|
|
|
var el = document.createElement("div"); |
|
|
|
el.innerText = data[i].data[j].num |
|
|
|
el.className = "label-number-point-class"; |
|
|
|
el.classList.add(data[i].data[j].type); |
|
|
|
el.onclick= |
|
|
|
function(e) { |
|
|
|
e.stopPropagation() |
|
|
|
} |
|
|
|
// el.textContent = data[i].peopleType+':'+data[i].personnelNum; |
|
|
|
console.log(data[i].data[j]) |
|
|
|
const numPointMarkerItem = new Marker({ |
|
|
|
offsets: data[i].data[j].offsets, |
|
|
|
element: el, |
|
|
|
}).setLnglat([data[i].data[j].longitude * 1, data[i].data[j].latitude * 1]); |
|
|
|
|
|
|
|
numPointMarkerItem.on("click", (e) => { |
|
|
|
console.log(e,'sssddeeee') |
|
|
|
this.$emit('showMapDialog',e) |
|
|
|
// this.$router.push(`/homeDetails/index?id=${data[i].id}&typeB=${peopleType}`); |
|
|
|
}); |
|
|
|
numPointMarker.addMarker(numPointMarkerItem); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
scene.addMarkerLayer(numPointMarker); |
|
|
|
},*/ |
|
|
|
setNumpoint(data) { |
|
|
|
this.clearMarkert(); |
|
|
|
if (!scene.hasImage('resources')) { |
|
|
|
@ -931,13 +881,11 @@ export default { |
|
|
|
|
|
|
|
let pointData = data.map(item => item.data) |
|
|
|
pointData = pointData.reduce((a, b) => a.concat(b), []); |
|
|
|
console.log(pointData, 'pointData11') |
|
|
|
pointData = pointData.filter(item => { |
|
|
|
if(item.num > 0 && !isNaN(item.latitude)&& !isNaN(item.longitude)) { |
|
|
|
return true |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(this.level,'this.level') |
|
|
|
if (this.level != "street") { |
|
|
|
pointData = pointData.filter(item => item.type != 'resources') |
|
|
|
} |
|
|
|
@ -953,7 +901,6 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
.shape('type', (type) => { |
|
|
|
console.log(type, 'type') |
|
|
|
return type |
|
|
|
}) |
|
|
|
.size(32); |
|
|
|
@ -978,7 +925,6 @@ export default { |
|
|
|
}) |
|
|
|
scene.addLayer(numPointMarker2); |
|
|
|
numPointMarker1.on("click", (e) => { |
|
|
|
console.log(e, 'imageLayer') |
|
|
|
this.$emit('showMapDialog', e.feature) |
|
|
|
}) |
|
|
|
// scene.addMarkerLayer(numPointMarker); |
|
|
|
@ -990,7 +936,6 @@ export default { |
|
|
|
}, |
|
|
|
setResourcesPoint(data) { |
|
|
|
this.removeResourcesPoint() |
|
|
|
console.log(data, 'mapData') |
|
|
|
if (!scene.hasImage('resources01')) { |
|
|
|
scene.addImage('resources01', require('@/assets/images/overview/resources01.png')); |
|
|
|
scene.addImage('resources02', require('@/assets/images/overview/resources02.png')); |
|
|
|
@ -999,7 +944,6 @@ export default { |
|
|
|
scene.addImage('resources05', require('@/assets/images/overview/resources05.png')); |
|
|
|
} |
|
|
|
|
|
|
|
console.log(data, 'pointData') |
|
|
|
ResourcesPoint = new PointLayer({ |
|
|
|
name: 'ResourcesPoint', |
|
|
|
zIndex: 22, |
|
|
|
@ -1012,13 +956,11 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
.shape('dataClass', (dataClass) => { |
|
|
|
console.log(dataClass, 'dataClass') |
|
|
|
return 'resources0' + dataClass |
|
|
|
}) |
|
|
|
.size(18); |
|
|
|
scene.addLayer(ResourcesPoint); |
|
|
|
ResourcesPoint.on("click", (e) => { |
|
|
|
console.log(e, 'ResourcesPoint') |
|
|
|
this.$emit('resourcesPointClick', e.feature) |
|
|
|
}) |
|
|
|
|
|
|
|
@ -1043,8 +985,6 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
marker.on("click", (e) => { |
|
|
|
console.log("click", e); |
|
|
|
// this.handleClickDot(item, posArr); |
|
|
|
marker.openPopup(); |
|
|
|
}); |
|
|
|
|
|
|
|
@ -1055,12 +995,10 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
removeDotMarker() { |
|
|
|
console.log("removeDotMarker"); |
|
|
|
if (searchMarker) { |
|
|
|
searchMarker.remove(); |
|
|
|
} |
|
|
|
if (searchBgLayer) { |
|
|
|
console.log("removeDotMarker-----searchBgLayer"); |
|
|
|
this.drawSearchBg(); |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -1080,12 +1018,10 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
handleClickDotBtn(type, info) { |
|
|
|
console.log(type, info); |
|
|
|
this.$emit("clickDotBtn", type, info); |
|
|
|
}, |
|
|
|
|
|
|
|
handleClickDotListItem(item) { |
|
|
|
console.log("handleClickDotListItem", item); |
|
|
|
this.handleClickDot(item, [parseFloat(item.longitude), parseFloat(item.latitude)]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|