From 7b0ea77499d3242e9a48c2f67302fa8e9e105271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?junh=5Feee=28=EC=9D=B4=EC=A4=80=ED=9D=AC=29?= Date: Tue, 16 Jan 2024 14:38:38 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=A0=EC=94=A8=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=9C=84=EC=B9=98=EA=B2=80=EC=83=89=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20naver=20=EA=B1=B7=EC=96=B4?= =?UTF-8?q?=EB=82=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/weather/WeatherView.js | 34 +++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/views/weather/WeatherView.js b/src/views/weather/WeatherView.js index 5f456d12..dfe32cfe 100644 --- a/src/views/weather/WeatherView.js +++ b/src/views/weather/WeatherView.js @@ -36,17 +36,41 @@ const WeatherView = () => { } }; const handleCoord = (mapx, mapy) => { - let utmk = naver.maps.TransCoord.fromTM128ToUTMK( - naver.maps.Point(mapx, mapy) - ); - let latlng = naver.maps.TransCoord.fromUTMKToLatLng(utmk); + const numberString = [mapx, mapy]; + const latlng = []; + + numberString.map(coord => { + let digits = coord.split(''); + + if (digits[0] !== '1') { + digits.splice(2, 0, '.'); + } else { + digits.splice(3, 0, '.'); + } + + latlng.push(Number(digits.join(''))); + }); setIsSearch(false); - setMap(latlng); let options = { duration: 800, easing: 'easeOutCubic' }; + setMap({ _lat: latlng[1], _lng: latlng[0] }); + + // let utmk = naver.maps.TransCoord.fromTM128ToUTMK( + // naver.maps.Point(mapx, mapy) + // ); + // let latlng = naver.maps.TransCoord.fromUTMKToLatLng(utmk); + // setIsSearch(false); + + // setMap(latlng); + // let options = { + // duration: 800, + // easing: 'easeOutCubic' + // }; + // console.log(latlng, '---latlng'); + // map.morph(latlng, 16, options) }; const handleEnter = e => {