Converting between Coordinate Systems using Geocoder
The Geocoder submodule provides expanded projection objects supporting geocoding/reverse geocoding methods and specific coordinate systems.
For examples of using the Geocoder submodule, refer to Geocoder examples.
Load submodules
To use Geocoder, you should load the JavaScript file of the Geocoder submodule. Load the file as in the code below.
This submodule requires the NAVER Maps API v3 to be loaded in advance. For more information, refer to Submodule System.
The NAVER Maps API v3 supports both
http
andhttps
protocols.
<script type="text/javascript" src="https://oapi.map.naver.com/openapi/v3/maps.js?ncpClientId=YOUR_CLIENT_ID&submodules=geocoder"></script>
Convert between coordinate systems
The Geocoder submodule provides a method to convert between coordinate systems. The available coordinate systems are listed below.
More coordinate systems will be added continuously.
- LatLng: Latitude and longitude coordinate system
- UTMK: UTMK coordinate system
- NAVER: NAVER’s own coordinate system
- TM128: TM128 coordinate system
Use the naver.maps.TransCoord
static object to convert between coordinate systems.
var latlng = new naver.maps.LatLng(37.5666103, 126.9783882); // Lat/lng coordinates of Seoul City Hall
var utmk = naver.maps.TransCoord.fromLatLngToUTMK(latlng); // Lat/lng -> UTMK
var tm128 = naver.maps.TransCoord.fromUTMKToTM128(utmk); // UTMK -> TM128
var naverCoord = naver.maps.TransCoord.fromTM128ToNaver(tm128); // TM128 -> NAVER
Examples: Converting between coordinate systems