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 => {