From 1.5.41 pro version available new option – search markers by location.
To start using search by location you need to enable options in the map settings:
– Enable Google Places searchbox
– Enable searchbox by address
– Searchbox by Structured address (available if active Enable searchbox by address)
– Enable searchbox by Radius
– Enable Radius by miles (available if active Enable searchbox by Radius)
– Set default Radius value (available if active Enable searchbox by Radius)
there are several ways to use Search markers by location
– by Google Places searchbox
– by Google Places searchbox + Search radius
– by query searchbox from Nominatim API
– by query searchbox from Nominatim API + Search radius
– by Structured searchbox from Nominatim API
– by Structured searchbox from Nominatim API + Search radius
First for use options Search radius and options searchbox from Nominatim
you need add new shortcode
1 |
[search] |
on your map layout
1 by Google Places searchbox and by Google Places searchbox + Search radius
added to map Google autocomplete place search
for use this you need include Google JS on the page global map otions
Unlike the free version
the result of the search by location searches for the nearest markers by radius
by default, the search radius is 25 km
you can activate search by radius in the map settings and the set radius value
If the markers are not found, you will receive an error message
“no locations found try increasing the search radius” below the radius selection.
If you not use radius options you need add
1 |
<div class="LA_search_location_result_error"></div> |
to your map layout
2 by query searchbox from Nominatim API
Added simple searchbox by locations and return first 5 results from which you must choose
Is not autocomplete available because Nominatim API has restrict on 1 request per sec
after choose location if markers no found you recive error message, eg
3 by Structured searchbox from Nominatim API + Search radius (recommend)
This advance search from Nominatim API by Structured address: House number/Street, City, County, State, Country, Postal Code
you will get the most accurate results
if you don’t need one of the fields, you can hide it with css
if you need to set one of the default fields
use snippet
1 |
jQuery("input[name='locate-anything-search_box-country']").val('USA'); |
and the search will be only by country USA