diff --git a/src/views/modules/visual/communityGovern/cpt/project-info.vue b/src/views/modules/visual/communityGovern/cpt/project-info.vue index 30e768c6..c1ae0326 100644 --- a/src/views/modules/visual/communityGovern/cpt/project-info.vue +++ b/src/views/modules/visual/communityGovern/cpt/project-info.vue @@ -581,7 +581,7 @@ export default { const { data, code, msg } = await requestPost(url, { categoryCodeList: this.categoryCodes, userId: this.userId, - + projectId: this.projectIdCopy }); if (code === 0) { diff --git a/src/views/modules/visual/components/screen-map/index.vue b/src/views/modules/visual/components/screen-map/index.vue index 3e593ed5..eba9be98 100644 --- a/src/views/modules/visual/components/screen-map/index.vue +++ b/src/views/modules/visual/components/screen-map/index.vue @@ -3,8 +3,15 @@
你点击了这里:
+ //经纬度:
+ //
坐标:
X: Y: `; + // _that.overlay.setPosition(evt.coordinate); //把 overlay 显示到指定的 x,y坐标 + + + } else { + console.log('此处没有标注') + } + + } + + }); + }, + + handleShowPopup (showData, coordinate) { + console.log(this.overlay.getElement()) + this.overlay.getElement().style.display = 'block' + this.overlay.getElement().parentNode.style.display = 'block' + this.overlay.getElement().parentNode.parentNode.style.display = 'block' + var content = document.getElementById("popup-content"); + + content.innerHTML = showData; + this.overlay.setPosition(coordinate); //把 overlay 显示到指定的 x,y坐标 + }, //取随机数 getRndBetween (lowerLimit, upperLimit) { @@ -582,6 +659,17 @@ const vueGis = { showIconLayer: { type: Boolean, default: false + }, + //是否添加弹出框图层 + isAddOpenlay: { + type: Boolean, + default: false + }, + + //点击地图事件类型,back:返回,popup:弹出层 + clickType: { + type: String, + default: 'back' } }, @@ -623,4 +711,51 @@ export default vueGis; .ol-overlaycontainer-stopevent { display: none; } +.ol-popup { + position: absolute; + background-color: #1257c9; + -webkit-filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); + filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); + padding: 15px; + border-radius: 10px; + border: 1px solid #1257c9; + bottom: 12px; + left: -50px; + text-align: left; +} +.ol-popup:after, +.ol-popup:before { + top: 100%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; +} +.ol-popup:after { + border-top-color: 1257c9; + border-width: 10px; + left: 48px; + margin-left: -10px; +} +.ol-popup:before { + border-top-color: #1257c9; + border-width: 11px; + left: 48px; + margin-left: -11px; +} +.ol-popup-closer { + text-decoration: none; + position: absolute; + top: 2px; + right: 8px; +} +.popup-content { + width: 300px; +} +.ol-popup-closer:after { + content: "✖"; + color: rgba(1, 17, 104, 1); +} \ No newline at end of file diff --git a/src/views/modules/visual/measure/volunteer.vue b/src/views/modules/visual/measure/volunteer.vue index 233525b1..2075ccde 100644 --- a/src/views/modules/visual/measure/volunteer.vue +++ b/src/views/modules/visual/measure/volunteer.vue @@ -74,8 +74,10 @@