Possibility of location search and showing the places on the map makes the map more valuable. For example, you could show restaurants or public transport stations on a map to improve the customer experience.
But it’s always a question what to show on the map and how to provide the most relevant information to your clients.
Ways to query points of interest
There are a few ways to query locations and show them on a map:
- By bounding box. Allows showing all points of interest on the screen.
- By radius map. This way you can visualize potentially reachable points of interest.
- By travel time map. It’s a more accurate approach than by radius map. In other words, travel time maps help to filter locations accessible within desired time with chosen transportation mode. For instance, driving, walking or by public transport.
Geoapify offers location search by bounding box and by travel time maps. We support a list of amenity types which is constantly filled up by new types. Read more about Geoapify Places API.
Location search by a bounding box
When there is no starting point for the search, for example, home address or exhibition place, it’s required to show points of interest on the whole visible area. So you need to query data for some bounding box, usually equal to the viewport of the map. There are some implementation details:
- Execute new query for each map move to load new locations.
- Define a minimal zoom level for the location search feature. Showing all points of interest for a small zoom level, for instance for the whole city, country or continent, doesn’t make sense.
- Places icons as marker pins help to make your map more informative. Read more about custom marker items.
Location search by a travel time map
Travel time maps or isochrones show area reachable within a given time from a location. For example, all areas within 20 minutes driving from your home or within 30 minutes by public transport from a conference location. The isochrones could be used as a filter for locations reachable within the desired time. So you can show the real situation on the map and display only relevant for your customer data. Moreover, there are some implementation benefits as well:
- You perform a query only ones per location, transportation mode, and time value.
- Amount of data doesn’t depend from map zoom level but from the size of the isochrone.
Places API from Geoapify
Geoapify offers quick and convenient location search for both methods: by boundary and by travel time map. Try our API in Playground without registration or register for free to integrate the solution into your application.