Browse Source

날씨 정보 위치검색 에러 수정 및 naver 걷어내기

master
junh_eee(이준희) 8 months ago
parent
commit
7b0ea77499
  1. 34
      src/views/weather/WeatherView.js

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

Loading…
Cancel
Save