Compare commits

...

3 Commits

3 changed files with 22 additions and 3 deletions

View File

@ -146,6 +146,7 @@ export function MapFun(mapObj) {
* @param {*} feature * @param {*} feature
*/ */
const _openPopupEventDetailNew = function(feature) { const _openPopupEventDetailNew = function(feature) {
debugger
if (feature.type == 'cameraTree') { if (feature.type == 'cameraTree') {
const elementHtml = createCameraDetailsPop(feature) const elementHtml = createCameraDetailsPop(feature)
const arr = [0, 0.0, '', '0', '0.0'] const arr = [0, 0.0, '', '0', '0.0']
@ -2024,6 +2025,25 @@ export function MapFun(mapObj) {
polygon.addTo(map) polygon.addTo(map)
PolygonArr.push(polygon) PolygonArr.push(polygon)
} }
const _addAreaToMapNew = function(latLng, data) {
//console.log('llllll', latLng)
//debugger
const polygon = L.polygon(latLng, { color: 'red' })
// map.fitBounds(polyline.getBounds())
polygon.addTo(map)
PolygonArr.push(polygon)
polygon.on('click', async e => {
console.log('pppooooo', e, data);
let feature = {
data: data,
type: "site",
latLng: latLng[0]
};
const elementHtml = createImportantAreaPopNew(feature)
L.popup({ className: 'site-popup', keepInView: false }).setLatLng(feature.latLng).setContent(elementHtml).openOn(map)
})
}
return { return {
// 按图层配置名称删除 // 按图层配置名称删除
removeLayerByLayerName: _removeLayerByLayerName, removeLayerByLayerName: _removeLayerByLayerName,
@ -2100,5 +2120,6 @@ export function MapFun(mapObj) {
addPathToMap: _addPathToMap, addPathToMap: _addPathToMap,
addPointTestOnMap: _addPointTestOnMap, addPointTestOnMap: _addPointTestOnMap,
addAreaToMap: _addAreaToMap, addAreaToMap: _addAreaToMap,
addAreaToMapNew: _addAreaToMapNew,
} }
} }

View File

@ -244,7 +244,6 @@ function createImportantAreaPop(feature) {
// 重点区域弹窗 // 重点区域弹窗
function createImportantAreaPopNew(feature) { function createImportantAreaPopNew(feature) {
bus.$emit('areaCauseAnalysis', feature.data) bus.$emit('areaCauseAnalysis', feature.data)
const popupDom = new Dom({ const popupDom = new Dom({
template: '<Important-Area-pop-new :feature="feature"></Important-Area-pop-new>', template: '<Important-Area-pop-new :feature="feature"></Important-Area-pop-new>',
data() { data() {

View File

@ -204,7 +204,6 @@ import { createImportantAreaPopNew } from '../../../../supermap/createMarkerPopu
}, },
// //
analyse(row) { analyse(row) {
debugger
// bus.$emit("openCauseAnalysis", row); // bus.$emit("openCauseAnalysis", row);
this.$parent.hiMapFun.removerPolygon() this.$parent.hiMapFun.removerPolygon()
this.$parent.removeRoadCauseAnalysis() this.$parent.removeRoadCauseAnalysis()
@ -232,7 +231,7 @@ import { createImportantAreaPopNew } from '../../../../supermap/createMarkerPopu
// //
let lonLat=arr[0]; let lonLat=arr[0];
this.$parent.hiMap.mapObj.map.flyTo({ lat: lonLat[1], lng:lonLat[0] },14); this.$parent.hiMap.mapObj.map.flyTo({ lat: lonLat[1], lng:lonLat[0] },14);
this.$parent.hiMapFun.addAreaToMap(areaLatLng) this.$parent.hiMapFun.addAreaToMapNew(areaLatLng,row)
} }
// else { // else {
// selectByAreaName({areaName:row.areaName}).then((res) => { // selectByAreaName({areaName:row.areaName}).then((res) => {