diff --git a/src/components/map/naver/NaverMap.js b/src/components/map/naver/NaverMap.js index cd171f4..716b57d 100644 --- a/src/components/map/naver/NaverMap.js +++ b/src/components/map/naver/NaverMap.js @@ -41,7 +41,7 @@ export const NaverCustomMap = () => { center: new naver.maps.LatLng(36.56793936069445, 127.85101412107547), zoom: 10, zoomControl: true, - mapTypeId: naver.maps.MapTypeId.HYBRID, + mapTypeId: naver.maps.MapTypeId.NORMAL, zoomControlOptions: { position: naver.maps.Position.TOP_LEFT, diff --git a/src/components/map/naver/dron/DronMarker.js b/src/components/map/naver/dron/DronMarker.js index 3ab76be..9cc3885 100644 --- a/src/components/map/naver/dron/DronMarker.js +++ b/src/components/map/naver/dron/DronMarker.js @@ -45,7 +45,7 @@ export const DronMarker = props => { hideProgressBar: true, position: toast.POSITION.BOTTOM_RIGHT, onClick: props => { - if(marker) handlerDronClick(marker); + if(marker) handlerDronClick(marker); } } ) @@ -91,13 +91,8 @@ export const DronMarker = props => { title: id, id: id, controlId: controlId, - icon: { - // content: [ - // '
dddd
', - - // ].join(''), - url: DronIcon, - // size: new naver.maps.Size(50, 50), + icon: { + url: DronIcon, origin: new naver.maps.Point(0, 0), anchor: new naver.maps.Point(15, 15), } @@ -109,17 +104,16 @@ export const DronMarker = props => { handlerDronClick(marker); }); + // drone 정보 창 + // markerInfoWindow(marker); + setArrMarkers(m => [...m, marker]); }; const handlerDronClick = marker => { const idntfNum = marker.id; - const contorlId = marker.controlId; - - // 클릭한 식별번호 정보를 가진 그룹 추출 - // const group = controlGroupAuthInfo.find(group => group.idntfNum === idntfNum); - - //히스토리 불러오기 + const contorlId = marker.controlId; + dispatch(objectClickAction(contorlId)); dispatch(controlGpDtlAction.request(contorlId)); dispatch(controlGpFlightPlanAction.request(idntfNum)); @@ -169,10 +163,10 @@ export const DronMarker = props => { if (isExists) { moveMarkers(isExists, position); } else { - addMarkers(position, item.objectId, item.controlId); + addMarkers(position, item.objectId, item.controlId); } } else { - addMarkers(position, item.objectId, item.controlId); + addMarkers(position, item.objectId, item.controlId); } }); } @@ -182,5 +176,43 @@ export const DronMarker = props => { setArrMarkers(arrData); }; + const markerInfoWindow = (marker) => { + controlGpList.forEach(gps => { + + const contents = [ + `
`, + `
`, + ` ${marker.id}`, + `
`, + `
`, + `
`, + ` ${gps.speed}${gps.speedType}`, + `
`, + `
`, + ` ${gps.elev}${gps.elevType}`, + `
`, + `
`, + ` ${gps.heading}`, + `
`, + `
`, + `
` + ].join(''); + + const info = new naver.maps.InfoWindow({ + id: marker.id, + content: contents, + backgroundColor: '#283046', //박스안쪽영역 컬러 + anchorSize: new props.naver.maps.Size(30, -10), + anchorSkew: false, + anchorColor: '#283046', + pixelOffset: new props.naver.maps.Point(20, -20) + }); + + console.log(info); + + info.open(props.map, marker); + }); + } + return null; }; diff --git a/src/modules/control/gp/sagas/controlGpSaga.ts b/src/modules/control/gp/sagas/controlGpSaga.ts index 560cd0c..eb33d06 100644 --- a/src/modules/control/gp/sagas/controlGpSaga.ts +++ b/src/modules/control/gp/sagas/controlGpSaga.ts @@ -35,12 +35,10 @@ function* getControlGpSaga( } }); } - - console.log('gps ', gpsData); yield put( Actions.controlGpAction.success({ - controlGpList: gpsData + controlGpList: data }) ); @@ -57,17 +55,20 @@ function* getControlGpSaga( yield put(Actions.controlGpRtDtlAction.request(detailData)); - // History Push + // History Push if(controlGpHistory) { - const stateHistory = controlGpHistory; - const history = stateHistory.map((h) => { - return { - ...h, - detailData - } - }); + const stateHistory = controlGpHistory.concat(); - yield put(Actions.controlGpHisAction.success(history)); + const hisObj = { + lat: detailData.lat, + lng: detailData.lng, + objectId: detailData.objectId + } + stateHistory.push(hisObj); + + yield put(Actions.controlGpHisAction.success({ + controlGpHistory: stateHistory + })); } } } catch (error) { diff --git a/src/modules/control/map/reducers/controlMapReducer.ts b/src/modules/control/map/reducers/controlMapReducer.ts index 0eb82f5..116007a 100644 --- a/src/modules/control/map/reducers/controlMapReducer.ts +++ b/src/modules/control/map/reducers/controlMapReducer.ts @@ -1,6 +1,6 @@ // ** Initial State const initialState = { - mapType: 'HYBRID', + mapType: 'NORMAL', objectId: null, isClickObject: false, area0001: true, // 비행금지 구역