The radius tag lists the locations within 25 km of a place, with their distance.
Template
{exp:reinos_maps_locator:radius location="utrecht" radius="25"}
{if no_results}
No result
{/if}
entry_id: {entry_id}<br>
distance: {radius}<br>
lat: {lat}<br>
lng: {lng}<br>
city: {city}<br>
street_name: {street_name}<br>
street_number: {street_number}<br>
postal_code: {postal_code}<br>
country: {country}<br>
country_code: {country_code}<br><br><br>
{/exp:reinos_maps_locator:radius}Build it in your own site
What this example needs in ExpressionEngine, step by step.
- Install Maps Locator and Maps.
- Create the field, with these short names:
Short name Type Notes store_locationMaps Set the field setting Mode to Single location: one marker per store, placed with the search field. Maps Locator indexes that marker, so this one field is the location for the map and the search. - Create the channel
stores(Stores) and assign the field. - In the settings of Maps Locator, turn on Reverse geocoding: a marker of a Maps field is saved as a coordinate, the reverse geocoding looks up its address and city (the city pages and a search on a city need them).
- Put the code in a template.
- Add a few stores (the demo site has 34 bike stores in the Netherlands).
This example comes from the Maps Locator docs: the preview runs exactly the code above.