공유하기 링크에 표시된 URLX, URLY 기준

카카오맵에서 "현재 보고 있는 지도"의 중심점을 확인하고 싶은데, HTML로 공유하기에서 얻어지는 링크 내 urlX, urlY를 WTM - WGS84 변환 API를 이용해 변환하면 자꾸 러시아쪽으로 잡아주네요. 아래 링크에 있는 urlX, urlY의 기준이 무엇인가요? (WTM이 아닌가요?)

<a href="https://map.kakao.com/?urlX=964740&urlY=1118917&urlLevel=7&map_type=TYPE_MAP&map_hybrid=false" target="_blank"><img width="504" height="310" src="https://map2.daum.net/map/mapservice?FORMAT=PNG&SCALE=40&MX=964740&MY=1118917&S=0&IW=504&IH=310&LANG=0&COORDSTM=WCONGNAMUL&logo=kakao_logo" style="border:1px solid #ccc"></a><div class="hide" style="overflow:hidden;padding:7px 11px;border:1px solid #dfdfdf;border-color:rgba(0,0,0,.1);border-radius:0 0 2px 2px;background-color:#f9f9f9;width:482px;"><strong style="float: left;"><img src="//t1.daumcdn.net/localimg/localimages/07/2018/pc/common/logo_kakaomap.png" width="72" height="16" alt="카카오맵"></strong><div style="float: right;position:relative"><a style="font-size:12px;text-decoration:none;float:left;height:15px;padding-top:1px;line-height:15px;color:#000" target="_blank" href="https://map.kakao.com/?urlX=964740&urlY=1118917&urlLevel=7&map_type=TYPE_MAP&map_hybrid=false">지도 크게 보기</a></div></div>

1개의 좋아요

Hello, @chogeosung

The urlX and urlY values use the WCONGNAMUL coordinate system, not WTM. To convert these coordinates to WGS84 (latitude/longitude), you need to use Kakao Maps API’s specific conversion method.

Here’s the solution:

// Converting WCONGNAMUL coordinates to WGS84
var mapPoint = new kakao.maps.Point(964740, 1118917); // urlX, urlY values
var geoCoord = mapPoint.toGeographic();

console.log('Latitude: ' + geoCoord.getLat());
console.log('Longitude: ' + geoCoord.getLng());

Alternatively, to get the center coordinates of the current map:

// Getting the current center point of the map
var center = map.getCenter();
console.log('Latitude: ' + center.getLat());
console.log('Longitude: ' + center.getLng());

Note 1:

  • WCONGNAMUL is a coordinate system specific to Kakao Maps
  • The WTM conversion API is not suitable for these coordinates
  • It’s always recommended to use Kakao Maps API’s own conversion methods
  • The provided urlX and urlY in the HTML sharing link are in WCONGNAMUL format

Note 2: Always use the Kakao Maps API methods for accurate conversion and positioning.

Thx! It works!
Have a great day! :slight_smile:

1개의 좋아요

@chogeosung You’re welcome, please mark the message that your problem is solved as “solved”. If there is another topic I can help you with, open a new topic and tag me.