diff --git a/src/utils/GISdocument/mapboxVectorLayer.js b/src/utils/GISdocument/mapboxVectorLayer.js index ca28221..cb3b471 100644 --- a/src/utils/GISdocument/mapboxVectorLayer.js +++ b/src/utils/GISdocument/mapboxVectorLayer.js @@ -88,7 +88,7 @@ } } //添加geojson Symbol - static addGeojsonSymbol(layerId, geojson, icon) { + static addGeojsonSymbol(layerId, geojson, icon, iconsize) { if (!newfiberMapbox.map.getLayer(layerId)) { newfiberMapbox.map.loadImage(icon, (error, image) => { if (error) throw error; @@ -116,7 +116,7 @@ 'text-allow-overlap': true, 'icon-allow-overlap': true, 'icon-anchor': 'center', - 'icon-size': 0.8, + 'icon-size': iconsize ? iconsize : 0.8, 'text-field': '{name}', 'text-font': ['KlokanTech Noto Sans Regular'], 'icon-rotate': ['get', 'bearing'], diff --git a/src/utils/GISdocument/mapboxVectorLayer.js b/src/utils/GISdocument/mapboxVectorLayer.js index ca28221..cb3b471 100644 --- a/src/utils/GISdocument/mapboxVectorLayer.js +++ b/src/utils/GISdocument/mapboxVectorLayer.js @@ -88,7 +88,7 @@ } } //添加geojson Symbol - static addGeojsonSymbol(layerId, geojson, icon) { + static addGeojsonSymbol(layerId, geojson, icon, iconsize) { if (!newfiberMapbox.map.getLayer(layerId)) { newfiberMapbox.map.loadImage(icon, (error, image) => { if (error) throw error; @@ -116,7 +116,7 @@ 'text-allow-overlap': true, 'icon-allow-overlap': true, 'icon-anchor': 'center', - 'icon-size': 0.8, + 'icon-size': iconsize ? iconsize : 0.8, 'text-field': '{name}', 'text-font': ['KlokanTech Noto Sans Regular'], 'icon-rotate': ['get', 'bearing'], diff --git a/src/views/oneMap/components/mapboxPopup.vue b/src/views/oneMap/components/mapboxPopup.vue index b3ce617..df1923e 100644 --- a/src/views/oneMap/components/mapboxPopup.vue +++ b/src/views/oneMap/components/mapboxPopup.vue @@ -492,7 +492,9 @@ allData.dataList = params.popupInfo; let pipePopupDiv = document.getElementById('cesiumPopupID'); - let popupCenter, center, offsets; + let popupCenter, + center, + offsets = null; if (allData.dataList.geometry) { if (allData.dataList.geometry.includes('LINESTRING')) { popupCenter = turf.center(turf.feature(Terraformer.WKT.parse(allData.dataList.geometry))).geometry.coordinates; @@ -501,6 +503,9 @@ } center = [popupCenter[0], popupCenter[1]]; offsets = [-130, 200]; + } else { + center = [params.point[0], params.point[1] + 0.0005]; + offsets = [-30, 200]; } if (allData.dataList.pumpCode) { allData.dataList.rainpump = JSON.parse(allData.dataList.rainpump); @@ -514,7 +519,7 @@ lat: popupCenter ? popupCenter[1] : params.point[1], }, anchor: 'center', - offsets: [-90, 130], + offsets: offsets ? offsets : [-90, 130], autoClose: false, }); newfiberMapbox.addPopup(pipePopup); @@ -583,7 +588,7 @@ color: #b8ecff; line-height: 22px; margin: 5px; - width: 330px; + width: 350px; padding-left: 25px; &:before { // display: block; diff --git a/src/utils/GISdocument/mapboxVectorLayer.js b/src/utils/GISdocument/mapboxVectorLayer.js index ca28221..cb3b471 100644 --- a/src/utils/GISdocument/mapboxVectorLayer.js +++ b/src/utils/GISdocument/mapboxVectorLayer.js @@ -88,7 +88,7 @@ } } //添加geojson Symbol - static addGeojsonSymbol(layerId, geojson, icon) { + static addGeojsonSymbol(layerId, geojson, icon, iconsize) { if (!newfiberMapbox.map.getLayer(layerId)) { newfiberMapbox.map.loadImage(icon, (error, image) => { if (error) throw error; @@ -116,7 +116,7 @@ 'text-allow-overlap': true, 'icon-allow-overlap': true, 'icon-anchor': 'center', - 'icon-size': 0.8, + 'icon-size': iconsize ? iconsize : 0.8, 'text-field': '{name}', 'text-font': ['KlokanTech Noto Sans Regular'], 'icon-rotate': ['get', 'bearing'], diff --git a/src/views/oneMap/components/mapboxPopup.vue b/src/views/oneMap/components/mapboxPopup.vue index b3ce617..df1923e 100644 --- a/src/views/oneMap/components/mapboxPopup.vue +++ b/src/views/oneMap/components/mapboxPopup.vue @@ -492,7 +492,9 @@ allData.dataList = params.popupInfo; let pipePopupDiv = document.getElementById('cesiumPopupID'); - let popupCenter, center, offsets; + let popupCenter, + center, + offsets = null; if (allData.dataList.geometry) { if (allData.dataList.geometry.includes('LINESTRING')) { popupCenter = turf.center(turf.feature(Terraformer.WKT.parse(allData.dataList.geometry))).geometry.coordinates; @@ -501,6 +503,9 @@ } center = [popupCenter[0], popupCenter[1]]; offsets = [-130, 200]; + } else { + center = [params.point[0], params.point[1] + 0.0005]; + offsets = [-30, 200]; } if (allData.dataList.pumpCode) { allData.dataList.rainpump = JSON.parse(allData.dataList.rainpump); @@ -514,7 +519,7 @@ lat: popupCenter ? popupCenter[1] : params.point[1], }, anchor: 'center', - offsets: [-90, 130], + offsets: offsets ? offsets : [-90, 130], autoClose: false, }); newfiberMapbox.addPopup(pipePopup); @@ -583,7 +588,7 @@ color: #b8ecff; line-height: 22px; margin: 5px; - width: 330px; + width: 350px; padding-left: 25px; &:before { // display: block; diff --git a/src/views/oneMap/index.vue b/src/views/oneMap/index.vue index f738339..23d921f 100644 --- a/src/views/oneMap/index.vue +++ b/src/views/oneMap/index.vue @@ -5,20 +5,14 @@
延安市城市生命线安全运行监测系统
- + 延安
@@ -39,9 +33,7 @@ - + @@ -69,48 +61,19 @@ :class="[showPanel ? 'TuChengImgTrue' : 'TuChengImgFalse']" v-if="AllData.MapShowBol" /> - + - + - + - + - - + - + - + - +
@@ -138,11 +97,7 @@