Browse Source

naver 걷어내기

master
junh_eee(이준희) 8 months ago
parent
commit
352550ba63
  1. 2
      src/components/laanc/step/LaancStep2.js
  2. 73
      src/components/map/mapbox/dron/DronMarker.js
  3. 24
      src/components/map/naver/NaverMapControl.js

2
src/components/laanc/step/LaancStep2.js

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect, useState, lazy } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import '@styles/react/libs/flatpickr/flatpickr.scss';
import { CheckCircle } from 'react-feather';

73
src/components/map/mapbox/dron/DronMarker.js

@ -115,50 +115,6 @@ export const DronMarker = props => {
}
}, [isClickObject]);
// useEffect(() => {
// let imageUrl;
// arrMarkers.map(clickMarker => {
// if (objectId === clickMarker.controlId && isClickObject) {
// // console.log(clickMarker.gps.objectId, '><><');
// imageUrl =
// // clickMarker.type === 'DRONE' ? DronUamDetailIcon : FlightDetailIcon;
// clickMarker.type === 'DRONE'
// ? clickMarker.gps.objectId.includes('UAM')
// ? DronUamDetailIcon
// : DronDetailIcon
// : FlightDetailIcon;
// clickMarker.setIcon({
// content: `<img src="${imageUrl}" alt="" style="transform: rotate(${clickMarker.gps.heading}deg)">`,
// origin: new naver.maps.Point(0, 0),
// anchor: new naver.maps.Point(15, 15)
// });
// } else {
// // imageUrl = clickMarker.type === 'DRONE' ? DronUamIcon : FlightIcon;
// imageUrl =
// clickMarker.type === 'DRONE'
// ? clickMarker.gps.objectId.includes('UAM')
// ? DronUamIcon
// : DronIcon
// : FlightIcon;
// clickMarker.setIcon({
// content: `<img src="${imageUrl}" alt="" style="transform: rotate(${clickMarker.gps.heading}deg)">`,
// origin: new naver.maps.Point(0, 0),
// anchor: new naver.maps.Point(15, 15)
// });
// }
// });
// }, [objectId, isClickObject]);
// useEffect(() => {
// arrMarkers.map(clickMarker => {
// if (objectId === clickMarker.controlId) {
// dispatch(controlGpDtlAction.request(objectId));
// props.map.setCenter(clickMarker.getPosition());
// props.map.setZoom(13, true);
// }
// });
// }, [objectId]);
//마커 생성
const addMarkers = (position, id, controlId, gps) => {
const gpsCnt = {
@ -228,34 +184,6 @@ export const DronMarker = props => {
}));
}
// if (id.substring(0, 2) === 'PA') {
// const pal = controlGroupAuthInfo?.find(
// prev => prev.idntfNum === gps.objectId
// );
// markerOption.url = pal ? DronIcon : FlightIcon;
// markerOption.type = pal ? 'DRONE' : 'FLIGHT';
// } else {
// markerOption.url = FlightIcon;
// markerOption.type = 'FLIGHT';
// }
// markerOption.origin = new naver.maps.Point(0, 0);
// markerOption.anchor = new naver.maps.Point(15, 15);
// const marker = new naver.maps.Marker({
// position: position,
// title: id,
// id: id,
// controlId: controlId,
// type: markerOption.type,
// icon: {
// content: `<img id=${id} src="${markerOption.url}" alt="" style="transform: rotate(${gps.heading}deg);">`,
// origin: markerOption.origin,
// anchor: markerOption.anchor
// },
// gps: gps
// });
// marker.setMap(props.map);
const el = document.createElement('img');
el.id = id;
el.src = markerOption.url;
@ -405,7 +333,6 @@ export const DronMarker = props => {
if (controlGpList) {
allRemoveMarkers();
controlGpList.map((item, idx) => {
// let position = new naver.maps.LatLng(item.lat, item.lng);
let position = new props.mapboxgl.LngLat(item.lng, item.lat);
if (arrMarkers.length > 0) {

24
src/components/map/naver/NaverMapControl.js

@ -1,24 +0,0 @@
import { useEffect } from 'react';
import { useSelector } from 'react-redux';
const NaverMapControl = props => {
const mapControl = useSelector(state => state.controlMapReducer);
// useEffect(() => {
// }, []);
useEffect(() => {}, [mapControl]);
//맵타입 변경
if (mapControl.mapType === 'NORMAL') {
props.map.setMapTypeId(naver.maps.MapTypeId.NORMAL);
} else if (mapControl.mapType === 'TERRAIN') {
props.map.setMapTypeId(naver.maps.MapTypeId.TERRAIN);
} else if (mapControl.mapType === 'HYBRID') {
props.map.setMapTypeId(naver.maps.MapTypeId.HYBRID);
}
return null;
};
export default NaverMapControl;
Loading…
Cancel
Save