Browse Source

Merge branch 'master' of http://gitea.palntour.com/pav/pav-home

feature/auth
junh_eee 2 years ago
parent
commit
ef90d79e62
  1. 35
      src/components/basis/flight/plan/FlightPlanAreaMap.js
  2. 10
      src/containers/basis/dron/BasisDronDetailContainer.js

35
src/components/basis/flight/plan/FlightPlanAreaMap.js

@ -23,11 +23,10 @@ const FlightPlanAreaMap = (props) => {
const [mode, setMode] = useState(); const [mode, setMode] = useState();
const [mapAreaCoordList, setMapAreaCoordList] = useState(initFlightBas.initDetail.areaList); const [mapAreaCoordList, setMapAreaCoordList] = useState(initFlightBas.initDetail.areaList);
let dragCircleSize;
useEffect(() => { useEffect(() => {
NaverMapInit(); NaverMapInit();
}, []); },[]);
useEffect(() => { useEffect(() => {
setIsMapLoad(true); setIsMapLoad(true);
@ -39,45 +38,40 @@ const FlightPlanAreaMap = (props) => {
}, [mapControl.drawType]); }, [mapControl.drawType]);
useEffect(() => { useEffect(() => {
// NaverMapInit(); if(areaCoordList) {
if(areaCoordList[0].coordList[0].lat !== 0 && areaCoordList[0].coordList[0].lon !== 0){
if(map) {
map.setCenter(new naver.maps.LatLng(areaCoordList[0].coordList[0].lat, areaCoordList[0].coordList[0].lon))
}
}
}
setMapAreaCoordList(areaCoordList) setMapAreaCoordList(areaCoordList)
}, [areaCoordList]); }, [areaCoordList]);
const ModeInit = () => { const ModeInit = () => {
setMode(mapControl.drawType) setMode(mapControl.drawType)
} }
const NaverMapInit = () => { const NaverMapInit = () => {
const center = {};
const bufferzoom ={}; const bufferzoom ={};
if(areaCoordList) { if(areaCoordList){
center.lat = areaCoordList[0].coordList[0].lat === 0 ? 37.520357 : areaCoordList[0].coordList[0].lat; if(areaCoordList[0].bufferZone>=0 && areaCoordList[0].bufferZone <2000){
center.lon = areaCoordList[0].coordList[0].lon === 0 ? 126.610166 : areaCoordList[0].coordList[0].lon;
if(areaCoordList[0].bufferZone>=0 && areaCoordList[0].bufferZone<2000){
bufferzoom.bufferzoom =13; bufferzoom.bufferzoom =13;
dragCircleSize = 15;
} }
else if(areaCoordList[0].bufferZone>=2000 && areaCoordList[0].bufferZone <5000){ else if(areaCoordList[0].bufferZone>=2000 && areaCoordList[0].bufferZone <5000){
bufferzoom.bufferzoom =12; bufferzoom.bufferzoom =12;
dragCircleSize = 20;
} }
else if(areaCoordList[0].bufferZone>=5000 && areaCoordList[0].bufferZone <=9000){ else if(areaCoordList[0].bufferZone>=5000 && areaCoordList[0].bufferZone <=9000){
bufferzoom.bufferzoom =11; bufferzoom.bufferzoom =11;
dragCircleSize = 25;
} }
else{ else{
bufferzoom.bufferzoom =10; bufferzoom.bufferzoom =10;
dragCircleSize = 30;
} }
} }
console.log("bufferzoom>>",bufferzoom); const mapOptions = {
console.log(center);
const mapOptions2 = {
// center: new naver.maps.LatLng(36.56793936069445, 127.85101412107547), // center: new naver.maps.LatLng(36.56793936069445, 127.85101412107547),
center: new naver.maps.LatLng(center.lat, center.lon), center: new naver.maps.LatLng(37.520357, 126.610166),
// zoom: 10, zoom: !areaCoordList ? 13 : bufferzoom.bufferzoom,
zoom: bufferzoom.bufferzoom,
zoomControl: true, zoomControl: true,
mapTypeId: naver.maps.MapTypeId.NORMAL, mapTypeId: naver.maps.MapTypeId.NORMAL,
zoomControlOptions: { zoomControlOptions: {
@ -85,7 +79,7 @@ const FlightPlanAreaMap = (props) => {
style: naver.maps.ZoomControlStyle.SMALL style: naver.maps.ZoomControlStyle.SMALL
} }
}; };
setMap(new naver.maps.Map('map', mapOptions2)); setMap(new naver.maps.Map('map', mapOptions));
} }
const handlerDrawType = val => { const handlerDrawType = val => {
@ -147,7 +141,6 @@ const FlightPlanAreaMap = (props) => {
handleCoordinates={handleCoordinates} handleCoordinates={handleCoordinates}
handleInitCoordinates={handleInitCoordinates} handleInitCoordinates={handleInitCoordinates}
handleConfirm={props.handleConfirm} handleConfirm={props.handleConfirm}
dragCircleSize={dragCircleSize}
/> : null} /> : null}
{/* <Button.Ripple {/* <Button.Ripple

10
src/containers/basis/dron/BasisDronDetailContainer.js

@ -179,9 +179,17 @@ export const BasisDronDetailContainer = props => {
> >
저장 저장
</Button.Ripple> </Button.Ripple>
<Button.Ripple color='danger' size='sm' onClick={handlerDelete}> {pageType != 'create'?
(
<Button.Ripple color='danger' size='sm' onClick={handlerDelete} >
삭제 삭제
</Button.Ripple> </Button.Ripple>
)
:
(
<></>
)
}
</div> </div>
</Col> </Col>
</Row> </Row>

Loading…
Cancel
Save