Browse Source

지도 검색 문법 에러 수정

pull/2/head
김장현 2 years ago
parent
commit
896cd88753
  1. 47
      src/components/basis/flight/plan/FlightPlanAreaMap.js

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

@ -1,6 +1,17 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Card, CardBody, Button, Input, Row, Col, InputGroup, InputGroupAddon, InputGroupText, FormGroup } from 'reactstrap'; import {
import { Search } from 'react-feather' Card,
CardBody,
Button,
Input,
Row,
Col,
InputGroup,
InputGroupAddon,
InputGroupText,
FormGroup
} from 'reactstrap';
import { Key, Search } from 'react-feather';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { FeatureAirZone } from '../../../map/naver/feature/FeatureAirZone'; import { FeatureAirZone } from '../../../map/naver/feature/FeatureAirZone';
import { import {
@ -160,7 +171,9 @@ const FlightPlanAreaMap = props => {
}; };
const handleCoord = (mapx, mapy) => { const handleCoord = (mapx, mapy) => {
let utmk = naver.maps.TransCoord.fromTM128ToUTMK(naver.maps.Point(mapx, mapy)); let utmk = naver.maps.TransCoord.fromTM128ToUTMK(
naver.maps.Point(mapx, mapy)
);
let latlng = naver.maps.TransCoord.fromUTMKToLatLng(utmk); let latlng = naver.maps.TransCoord.fromUTMKToLatLng(utmk);
setIsSearch(false); setIsSearch(false);
@ -168,9 +181,9 @@ const FlightPlanAreaMap = props => {
let options = { let options = {
duration: 800, duration: 800,
easing: 'easeOutCubic' easing: 'easeOutCubic'
} };
map.morph(latlng, 16, options) map.morph(latlng, 16, options);
} };
const handleEnter = e => { const handleEnter = e => {
if (e.key == 'Enter') { if (e.key == 'Enter') {
@ -209,10 +222,7 @@ const FlightPlanAreaMap = props => {
<InputGroup className='search-feather'> <InputGroup className='search-feather'>
<InputGroupAddon addonType='prepend'> <InputGroupAddon addonType='prepend'>
<InputGroupText> <InputGroupText>
<Search <Search size={14} onClick={handleSearch} />
size={14}
onClick={handleSearch}
/>
</InputGroupText> </InputGroupText>
</InputGroupAddon> </InputGroupAddon>
<Input <Input
@ -220,7 +230,7 @@ const FlightPlanAreaMap = props => {
id='searchInput' id='searchInput'
name='searchInput' name='searchInput'
bsSize='sm' bsSize='sm'
autocomplete='off' autoComplete='off'
placeholder='검색명을 입력하세요.' placeholder='검색명을 입력하세요.'
onChange={handleChange} onChange={handleChange}
onKeyPress={handleEnter} onKeyPress={handleEnter}
@ -228,15 +238,16 @@ const FlightPlanAreaMap = props => {
</InputGroup> </InputGroup>
<div className='search-result-comp'> <div className='search-result-comp'>
<ul> <ul>
{searchRes?.length!=0 && isSearch? ( {searchRes?.length !== 0 && isSearch ? (
searchRes?.map((prev, idx) => { searchRes?.map((prev, idx) => {
let title = prev.title.replaceAll('<b>', ''); let title = prev.title.replaceAll('<b>', '');
title = title.replaceAll('</b>', ''); title = title.replaceAll('</b>', '');
return ( return (
<> <li
<li onClick={() => handleCoord(prev.mapx, prev.mapy)}> key={prev.address}
onClick={() => handleCoord(prev.mapx, prev.mapy)}
>
<a> <a>
<div className='search-result'> <div className='search-result'>
<div className='title'> <div className='title'>
@ -251,9 +262,7 @@ const FlightPlanAreaMap = props => {
</div> </div>
</a> </a>
</li> </li>
</> );
)
}) })
) : ( ) : (
<></> <></>
@ -282,8 +291,6 @@ const FlightPlanAreaMap = props => {
검색 검색
</Button.Ripple> </Button.Ripple>
</div> */} </div> */}
</div> </div>
</div> </div>

Loading…
Cancel
Save