Problem:
A Places post type has an address field. When viewing one place, how to show a map with other nearby places?
Solution:
You use a View to create the map as normal, but when inserting the View in a template for Places you include a distance Query Filter to show places within a certain distance of the location which is passed by shortcode attribute 'mapcenter'.
Then when you insert the View in the template you use the types address field to provide the mapcenter attribute, like so:
[wpv-view name="nearby-locations" mapcenter="[types field='home-address'][/types]"]
Relevant Documentation:
https://toolset.com/documentation/user-guides/display-on-google-maps/displaying-markers-on-google-maps/
https://toolset.com/documentation/user-guides/passing-arguments-to-views/
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 |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 4 replies, has 2 voices.
Last updated by 6 years, 5 months ago.
Assisted by: Nigel.