From 22db8d373d42f45a164a6bda9b2aa360452d8998 Mon Sep 17 00:00:00 2001 From: licuizhu <1065490369@qq.com> Date: Mon, 6 Nov 2023 22:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=9B=BE=E5=B1=82=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E5=B1=95=E7=A4=BA/=E5=9B=BE=E5=B1=82=E6=A0=91=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.less | 22 +++++++++++++++++++++- src/pages/BaseMap/index.js | 17 +++++++++-------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/index.less b/src/index.less index 6826e6fd..55c77b48 100644 --- a/src/index.less +++ b/src/index.less @@ -96,7 +96,7 @@ body { /* LayerData */ .layer-data-wrap { position: fixed; - top: 130px; + top: 190px; width: 220px; z-index: 999; margin: 2% 4.2%; @@ -259,4 +259,24 @@ body { font-weight: 400; color: #3D3D3D; margin-bottom: 8px; +} +.popup-btn-wrap { + float: right; +} +.popup-btn-wrap span { + margin-right: 10px; +} +.popup-edit { + color: #2F66F2; + cursor: pointer; +} +.popup-edit:hover { + color: #6991f6; +} +.popup-del { + color: #FA5151; + cursor: pointer; +} +.popup-del:hover { + color: #f57272; } \ No newline at end of file diff --git a/src/pages/BaseMap/index.js b/src/pages/BaseMap/index.js index 3a37c2a0..e4434acb 100644 --- a/src/pages/BaseMap/index.js +++ b/src/pages/BaseMap/index.js @@ -149,18 +149,24 @@ class BaseMap extends React.Component{ } } } + // 点击点显示详细信息 + markerEdit = (e) => { + console.log(111); + } + // 在地图上设置点位 【经度,纬度】 setMarkers = (data, layerId) => { let self = this; let map = this.state.map; let LabelsData = data || []; let markerLayer = new MarkerLayer({name: layerId}); - let el, popup, marker; + let el, popup, marker, icon;debugger for (let i = 0; i < LabelsData.length; i++) { + icon = LabelsData[0].logoImage; el = document.createElement('label'); el.style.width = '22px'; el.style.height = '22px'; - el.style.background = 'url("' + icon3 + '") no-repeat'; + el.style.background = 'url("' + icon + '") no-repeat'; el.style.backgroundSize = 'contain'; popup = new Popup({ offsets: [0, 30] @@ -169,6 +175,7 @@ class BaseMap extends React.Component{