Geocoding search results closer to specific point

To enhance search results, the geocoding control prioritizes locations that are closer to a specific geographical point. By utilizing the proximity options in the control constructor, results near the provided point are ranked higher. The geographical point is defined by its latitude and longitude [lat, lng]. For a complete list of geocoding control options, refer to the Geocoding control’s reference documentation. In the given example, we aim to prioritize results that are near Times Square in New York (e.g., “Park Avenue”).



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