From version 3.9.8 onwards Map List Pro looks for parameters passed via the url and uses these to prefill the search. These parameters are:
- locationSearchTerms
- textSearchTerms
- searchDistance
“locationSearchTerms” is the default parameter used for searching and is all you need to pass for location and text search modes. If you’re using the combo search mode you’ll need to use “locationSearchTerms” for the location bit, and textSearchTerms for the text search part. If you want to specify a distance filter for the location search then add searchDistance. Examples of search urls are:
www.yousitedomain.com/
www.yousitedomain.com/
You can add a search box on any page of your site using the following html:
1 2 3 4 |
<form action="/locations"><!--Relative url to the page that your map is on--> <input type="text" name="locationSearchTerms"><br> <input type="submit" value="Search Locations"><br> </form> |
You will need to change “/locations” on the first line to the url of your map page.
Combo search (location and text)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<form action="/locations"><!--Relative url to the page that your map is on--> <input type="text" name="textSearchTerms"><br> <select name="searchDistance" id="searchDistance"> <option value="10">within 10 Miles of</option> <option value="15">within 15 Miles of</option> <option value="20">within 20 Miles of</option> <option value="25">within 25 Miles of</option> <option value="30">within 30 Miles of</option> <option value="35">within 35 Miles of</option> </select><br> <input type="text" name="locationSearchTerms"><br> <input type="submit" value="Search Locations"><br> </form> |
You will need to change “/locations” on the first line to the url of your map page.