Locate users by IP address (IP geolocation)
IP geolocation is a feature that identifies a visitor’s location based on their IP address. This makes it possible to customize the map, website or application for your users. For example, you can center the initial map display to their location, show map labels in local language, and provide the correct cookie information.
Our IP geolocation service is available via the Geolocation API endpoint. For more convenient use, we provide a Geolocation API client which wraps the API calls in easy-to-use functions. You can also get these functions plus a complete dev kit with our MapTiler SDK JS.
Note that you’ll need a MapTiler API key to access our geocoding services, regardless of which tool or library you use.
Set map to visitor’s location
Get an approximate position and country bounds, so you can show the map at the visitor’s location. If they’re at home, they’ll see a familiar area on the map, and if they’re travelling, they’ll find their way around faster. 👉 How to center map based on visitor’s location
Set map to local language
MapTiler maps can be manually set to show labels in virtually any language. Take this a step further by setting the language automatically based on visitor’s current location. 👉 How to change the map language based on visitor’s location
Customize disputed borders
Some areas of the world face territorial disputes that often make it unclear what the correct country borders are. The topic can be quite sensitive, so it’s a good idea to configure your map so that it shows the borders differently based on how each involved country sees them. 👉 How to automatically change disputed borders based on visitor’s country
Customize cookies consent
IP geolocation can help display cookie information dynamically, for example, show the consent bar to visitors located in the European Union where it is required by law. 👉 How to display the cookies consent bar based on visitor’s location
Useful links
- Geolocation API
- Geolocation API client (JavaScript/TypeScript)
- IP geolocation examples and tutorials for MapTiler SDK JS
- MapTiler Countries (administrative units, ISO codes)
- Working with languages in MapTiler maps