Maps 관리자 Posted November 21, 2023 공유하기 Posted November 21, 2023 Static Map의 경우 레벨당 픽셀의 길이 혹은 축적의 경우, 20레벨의 경우 축적은 1:250 이고, pixel 당 0.0745m 입니다. (Static Map에서 20 레벨로 조회 시, 참고 사이트에서의 21레벨 기준으로 축척을 계산합니다. ) https://wiki.openstreetmap.org/wiki/Zoom_levels Mobile Dynamic Map의 경우 Projection.getMetersPerDp() 또는 getMetersPerPixel()으로 구할 수 있습니다. https://navermaps.github.io/android-map-sdk/reference/com/naver/maps/map/Projection.html#getMetersPerDp(double,double) Web Dynamic Map의 경우 축적을 통해서 계산하시거나 1px 의 거리를 통해서 원하시는 계산 결과를 도출하실 수 있습니다. ```code var map = new naver.maps.Map(""map"", { padding: { left: 0, top: 0 } }); function checkDistance() { var p1 = new naver.maps.Point(0, 0), p2 = new naver.maps.Point(1, 0), p3 = new naver.maps.Point(50, 0), proj = map.getProjection(), c1 = proj.fromOffsetToCoord(p1), c2 = proj.fromOffsetToCoord(p2), c3 = proj.fromOffsetToCoord(p3), dist1px = proj.getDistance(c1, c2), dist50px = proj.getDistance(c1, c3); console.log('1px:', dist1px, 'meter'); console.log('50px:', dist50px, 'meter'); } map.addListener('zoom_changed', function(zoom) { checkDistance(); }); checkDistance(); ``` https://navermaps.github.io/maps.js.ncp/docs/naver.maps.MapSystemProjection.html https://navermaps.github.io/maps.js.ncp/docs/tutorial-Projection.html https://navermaps.github.io/maps.js.ncp/docs/tutorial-shape-measures.example.html 링크 복사 다른 사이트에 공유하기 More sharing options...
Recommended Posts
게시글 및 댓글을 작성하려면 로그인 해주세요.
로그인