Appearance
Radius tag
Show locations based on a radius, from all channels. Only locations of entries with the status open are returned. Unlike the search_result tag, it doesn't look up missing address data of a location.
The tag
{exp:reinos_maps_locator:radius}Tag Parameters
Below are the Tag Parameters. Those parameters can be used in the tag described above
location
The location (address) to search from. This location will be geocoded. A coordinate (52.1,5.1) is used as is, without the geocoder.
location=""metric
set the type of metrics km or mile (also mi or miles). Any other value uses km.
metric="km"radius
The radius to search within, in the given metric, decimals are allowed (2.5). Default 100.
radius="100"sort
Order by is by radius, asc or desc. Default asc.
sort="asc"sticky_first
With yes the locations of sticky entries come first, then the rest by distance. For featured stores, e.g. dealers or flagship stores. Use {if sticky} to show them differently. (from v4.0.0)
sticky_first="no" [OPTIONAL]limit
The number of results per page, default 50. For use with the paging tags https://docs.expressionengine.com/latest/templates/pagination.html
limit="50"nearest
Available from v4.0.0
When the search has no results, show the nearest N locations instead, regardless of the radius, so a search never ends empty. Use {if nearest} to tell them apart. Default 0 (off).
nearest="5"max_radius
Available from v4.0.0
The largest radius a search can use, a larger radius (e.g. a changed form field) is cut off at this value. Default: no maximum.
max_radius="250"distance_decimals
Available from v4.0.0
The number of decimals of {distance}. Default 1.
distance_decimals="1"show_expired
Available from v4.0.0
Also return the locations of expired entries. Default no.
show_expired="yes"show_future_entries
Available from v4.0.0
Also return the locations of entries with an entry date in the future. Default no.
show_future_entries="yes"Tag Variables
Below are the Tag Variables. Those Variables can be used inside the tag described above.
entry_id
{entry_id}radius
The calculated distance between the searched location and this location
{radius}nearest
Available from v4.0.0
true when the results are the nearest locations because the search had no results (see the nearest parameter).
{if nearest && count == 1}No locations found, these are the nearest:{/if}distance
Available from v4.0.0
{radius} rounded to distance_decimals (default 1), with the unit in {distance_unit}
{distance} {distance_unit}distance_unit
Available from v4.0.0
km or mi, the unit of {distance}
{distance_unit}title
Available from v4.0.0
The title of the entry
{title}url_title
Available from v4.0.0
{url_title}entry_date
Available from v4.0.0
The entry date, with the date formatting of ExpressionEngine
{entry_date format="%Y-%m-%d"}expiration_date
Available from v4.0.0
The expiration date (0 without one), with the date formatting of ExpressionEngine
{expiration_date format="%Y-%m-%d"}lat
{lat}lng
{lng}city
{city}street_name
{street_name}street_number
{street_number}postal_code
{postal_code}country
{country}country_code
{country_code}Example
{exp:reinos_maps_locator:radius location="amsterdam" radius="50"}
{if no_results}
No result
{/if}
entry_id: {entry_id}<br>
radius: {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>
{/exp:reinos_maps_locator:radius}