From 50b5bca4861dbeb97b6a817f03c24c919ebaab40 Mon Sep 17 00:00:00 2001
From: 陈泽平 <qibolin02429@126.com>
Date: 星期一, 17 五月 2021 13:24:32 +0800
Subject: [PATCH] 企业点展示控制
---
src/components/LayerController/logic/SourcesPollution.js | 16 +++++++++++++++-
src/conf/MapConfig.js | 1 -
src/components/LayerController/logic/Company.js | 37 ++++++++-----------------------------
src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue | 2 --
src/components/panel/topicSearch/DischargeSearch.vue | 2 +-
5 files changed, 24 insertions(+), 34 deletions(-)
diff --git a/src/components/LayerController/logic/Company.js b/src/components/LayerController/logic/Company.js
index 962ec96..d6b7ea2 100644
--- a/src/components/LayerController/logic/Company.js
+++ b/src/components/LayerController/logic/Company.js
@@ -14,7 +14,6 @@
* 杩斿洖marker瀵硅薄鏁扮粍
* @param L leaflet瀵硅薄
*/
-
this.init = async (layer, L) => {
this.animalService = new AnimalService({
L: L,
@@ -40,29 +39,11 @@
className: 'company-bindTooltip',
iconSize: 16
})
-
const marker = L.marker([positionX, positionY], {
- /* icon: L.icon({
- iconUrl: iconUrl,
- iconSize: [30, 30],
- iconAnchor: [15, 15]
- }), */
icon: myIcon,
test: data[i]
})
- /* const htmls = '<ul><li>' + data[i].name + '</li></ul>'
- marker.bindTooltip(htmls, {
- permanent: true,
- offset: [0, 5],
- direction: 'bottom',
- className: 'company-bindTooltip'
- }) */
- // layer.addLayer(marker)
- if (window.map.getZoom() <= 5) {
- layer.addLayer(marker)
- } else if (window.map.getZoom() >= 12) {
- layer.removeLayer()
- }
+ layer.addLayer(marker)
}
}
/*
@@ -80,15 +61,13 @@
*
* */
this.clickListener = (e) => {
- console.log(e)
- window.map.setView(e.latlng, 13)
- if (window.map.getZoom() >= 12) {
- e.layer.remove()
- }
- // if (window.map.getZoom() <= 5) {
- // e.layer.addLayer()
- // } else if (window.map.getZoom() >= 12) {
- // e.layer.removeLayer()
+ // console.log(e)
+ window.map.setView(e.latlng, 15)
+ // if (window.map.getZoom() >= 10) {
+ // window.map.removeLayer(e.layer)
+ // e.layer.remove()
+ // } else if (window.map.getZoom() < 10) {
+ // window.map.addLayer(e.layer)
// }
// const dataValue = {
// StoragePlaceId: e.layer.options.test.name
diff --git a/src/components/LayerController/logic/SourcesPollution.js b/src/components/LayerController/logic/SourcesPollution.js
index a701f1c..27899ce 100644
--- a/src/components/LayerController/logic/SourcesPollution.js
+++ b/src/components/LayerController/logic/SourcesPollution.js
@@ -14,9 +14,23 @@
layer: layer
})
const result = await mapApi.getSourcesPoll()
- console.log(result)
+ // console.log(result)
const resultData = result.Result.DataInfo || []
const polygon = L.polygon(resultData, { color: 'yellow' })
polygon.addTo(layer)
}
+ this.bindTooltip = (layer) => {
+ return 'layer'
+ }
+ this.click = () => {
+ window.$layer.open({
+ content: {
+ content: 'Popup', // 缁勪欢
+ data: { // 浼犻�掔殑鍙傛暟
+ datas: 'popupDatas'
+ }
+ },
+ title: ''
+ })
+ }
}
diff --git a/src/components/panel/topicSearch/DischargeSearch.vue b/src/components/panel/topicSearch/DischargeSearch.vue
index f0fd797..f29036a 100644
--- a/src/components/panel/topicSearch/DischargeSearch.vue
+++ b/src/components/panel/topicSearch/DischargeSearch.vue
@@ -170,7 +170,7 @@
methods: {
flyto () {
const pos = [39.90751504898071, 116.38927817344666]
- window.map.flyTo(pos, 15)
+ window.map.setView(pos, 15)
},
// 鍖哄煙绛涢��
areaType (val) {
diff --git a/src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue b/src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue
index 59b3920..78533f5 100644
--- a/src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue
+++ b/src/components/panel/topicSearch/SewersSelect/SewersAnalysis.vue
@@ -527,9 +527,7 @@
this.bgPoint = res.data[0].startControlPoint
// const point = JSON.parse(this.bgPoint.geomText)
-
// const p = [point.coordinates[1], point.coordinates[0]]
-
// this.bgMarker = this.createFlowMarker(p)
// this.bgMarker = pulseEffect(p)
// this.bgMarker.bindTooltip(this.bgPoint.pointnumbe)
diff --git a/src/conf/MapConfig.js b/src/conf/MapConfig.js
index ec1f64e..4cae2f1 100644
--- a/src/conf/MapConfig.js
+++ b/src/conf/MapConfig.js
@@ -23,7 +23,6 @@
crs: L.CRS.EPSG4326,
minZoom: 3,
maxZoom: 21,
- // center: [26, 104],
center: [34.828558921813965, 117.41676807403564],
zoom: 5,
// center: [39.907214641571045, 116.39019012451172],
--
Gitblit v1.8.0