Use place and address search
Place and address search is typically available in a map as a simple search box. Behind the scenes, it hides a complex functionality that can be configured and used in many ways. See our interactive place search demo to get an idea!
How it works
The process that makes place search possible is called geocoding.
- Forward geocoding turns a human-friendly place name or address into geographical coordinates.
- Reverse geocoding does the same in the opposite direction, turning coordinates to the nearest place names and addresses.
The key component of place search is a geocoding index, which is a database that maps place names to their coordinates. Contents of the index determine the place types you’re able to find:
- Addresses, streets, postal codes, and administrative units
- Natural features such as mountains, forests, bodies of water
- Points of interest (POIs), which can be anything from shops and services to tourist attractions; there’s usually hundreds of POI categories.
How to integrate
Our place search is available via the Search and geocoding API. The API page explains how to use geocoding programmatically and which libraries (including 3rd party) you can use to query it, and provides complete API reference.
Use cases
There’s various real-life applications of geocoding. Here are the ones you’ll be most likely looking for:
Add a search box to map
A popular need is to add a place search box to your map or online form. To make this easy, we’ve prepared a geocoding control module which can be used with our maps or standalone. Add it using your favorite mapping library or JavaScript framework:
- MapTiler SDK JS – recommended for seamless integration with our maps. We provide a rich selection of configuration examples for the SDK, as well as React and Svelte tutorials.
- MapLibre GL JS – open-source vector map renderer. React and Svelte components are also available.
- Leaflet – popular, lightweight mapping library
- OpenLayers – powerful library for complex mapping needs
- Vanilla JS – pure HTML and JavaScript, no map
Zoom to first result
To get a simple application of geocoding without a search box, you can build a map which automatically shows the location of the first search result. The search query is a part of the URL that loads the map. 👉 Search and zoom to the result
Find by coordinates
Identify map locations on mouse click, track GPS positions of wildlife collars, monitor IoT devices in real time – all that is possible with reverse geocoding. It converts coordinates into meaningful place names by showing the nearest road, city, or point of interest, adding the required context to raw coordinate data. 👉 How to use reverse geocoding
Show close-by results
If you want to make place search more relevant to users, you can combine IP geolocation with the search to prioritize results near the user’s location. 👉 How to search places using visitor’s location
Batch geocoding
Sometimes, you need to convert hundreds or even thousands of addresses to coordinates (or vice versa), for example when you’re looking to optimize delivery routes to customers. With our geocoding service, you can process your entire address list in one batch. 👉 How to use batch geocoding
Offline search
You can also use place search in your self-hosted maps and offline environments. There’s just some extra steps needed to add the functionality to the on-prem setup. 👉 How to implement on-prem geocoding