Geocoding search for POIs near the user’s location

The search results filter in the geocoding control can be customized by specifying the type (poi) and giving higher priority to results near the user’s location. To search for points of interest (POIs) near the user, you can use the types and proximity options in the control constructor. The geographical point is represented by latitude and longitude coordinates [lat, lng]. For a complete list of geocoding control options, please refer to the Geocoding control’s reference documentation. In the example provided, we want to prioritize results near Times Square in New York, such as “hotels” and “bars”. To see the list of available place types, please check the place types list in the geocoding API documentation.

Learn more

Discover the process of integrating the geocoding control feature into your React (Geocoding React component) or Svelte (Geocoding Svelte component) applications. Additionally, you have the option to use the VanillaJS version to customize it for any of your applications.

Are you currently using a different map library? No worries! Learn how to incorporate the geocoding control functionality with Leaflet (Leaflet Geocoding control), OpenLayers (OpenLayers Geocoding control), or MapLibre GL JS (MapLibre GL JS Geocoding control).

Related examples

An extension of MapLibre GL JS