From 0347e828f674d147ed39918cad8f03660af3de04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kimjh=28=EA=B9=80=EC=9E=A5=ED=98=84=29?= Date: Fri, 18 Nov 2022 13:55:32 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B4=80=EC=A0=9C=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=EB=B8=94=EB=A1=9D=20=EC=9D=B4=EC=8A=88=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ src/components/map/naver/dron/DronMarker.js | 21 ++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index f3e3294..ad3df54 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,9 @@ .env.development.local .env.test.local .env.production.local +.env +.env.development +.env.production npm-debug.log* yarn-debug.log* diff --git a/src/components/map/naver/dron/DronMarker.js b/src/components/map/naver/dron/DronMarker.js index 02dee5f..d762197 100644 --- a/src/components/map/naver/dron/DronMarker.js +++ b/src/components/map/naver/dron/DronMarker.js @@ -424,6 +424,7 @@ export const DronMarker = props => { this.setMap(options.map || null); this.setId(options.id); this.setIdx(idx); + this.setControlId(options.controlId); }; CustomOverlay.prototype = new naver.maps.OverlayView(); @@ -461,11 +462,6 @@ export const DronMarker = props => { this._element.off(); }; - CustomOverlay.prototype.setElement = function (element, idx) { - this._element = element; - this.draw(idx); - }; - //속성 CustomOverlay.prototype.setPosition = function (position, idx) { this._position = position; @@ -491,6 +487,14 @@ export const DronMarker = props => { CustomOverlay.prototype.getIdx = function () { return this._idx; }; + + CustomOverlay.prototype.setControlId = function (controlId) { + this._controlId = controlId; + }; + + CustomOverlay.prototype.getControlId = function () { + return this._controlId; + }; }; const removeArrMarkers = arrData => { @@ -503,9 +507,11 @@ export const DronMarker = props => { const markerInfo = arrMarkers => { arrMarkers.forEach((marker, idx) => { + if (arrInfos.filter(i => i._controlId === marker.controlId).length > 0) { + return; + } infoInit(marker, controlGpList[idx], idx); - if (arrInfos.filter(i => i._idx === idx).length > 0) return; if (controlGpList.length != 0) { const info = new CustomOverlay({ position: new naver.maps.LatLng( @@ -514,7 +520,8 @@ export const DronMarker = props => { ), // map: map, id: marker.id, - idx: idx + idx: idx, + controlId: marker.controlId }); info.setMap(map);