Skip Navigation

[Resolved] Let the user search an address

This thread is resolved. Here is a description of the problem and solution.

Problem:

I've set up a map to display locations via their address field, working fine. Users can filter the map data using a form with filter.

I'd like to add one more filter/search field allowing the user to enter an address for positioning the map focus, on a particular zoom level, rather than filtering objects. How can that be achieved?

Example:
- user enters 'London' in search field

- no locations match this term (no title like 'london')

- show a map centered on 'London', eventually showing a marker labelled 'London'

Is there any way to achieve the desired results?

Solution:

In the latest version of Toolset map plugin, there is distance filter feature, our document:

https://toolset.com/2017/12/toolset-maps-1-4-with-geolocation-filtering-by-distance-and-custom-map-styles/

Relevant Documentation:

https://toolset.com/documentation/user-guides/display-on-google-maps/displaying-markers-on-google-maps/#displaying-current-visitor-location

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 3 voices.

Last updated by Glenn 6 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#625409

I've set up a map to display locations via their address field, working fine. Users can filter the map data using a form with filter.

I'd like to add one more filter/search field allowing the user to enter an address for positioning the map focus, on a particular zoom level, rather than filtering objects. How can that be achieved?

Furthermore, if the search doesn't return any hits (the user can enter a search term that filters 'title'), in the [wpv-no-items-found] section i would like to show the map with a marker trying to interprete the input value as an address.

Example:
- user enters 'London' in search field
- no locations match this term (no title like 'london')
- show a map centered on 'London', eventually showing a marker labelled 'London'

Is there any way to achieve the desired results?

Thanks a lot,
Sebastian

#625504
#625578

Thank you!

#626046

You are welcome

#1146110

Hold on its still not clear how to enter an address in a search field to the "re-center" the map... Can I get a little help