Problem: I would like to customize map pins (markers) so that when someone clicks a marker they are redirected to a custom URL.
Solution:
Right now there's no easy way to link to a specific URL when a marker is clicked. The easy way to handle this is to add the link inside the marker shortcode. The link will then be displayed in the marker popup. In this example I am adding a link using a URL custom field with the slug 'map-link-slug':
[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-id]' marker_field='wpcf-location'] [types field="map-link-slug" title="Click this link..."][/types] [/wpv-map-marker]
To customize the marker click action instead, you would need to write your own custom JavaScript. We don't offer much support for this feature because it's an advanced customization. With that being said, you can access the Map Marker objects in JavaScript at
WPViews.view_addon_maps.markers['yourMapID']
Relevant Documentation:
https://toolset.com/documentation/user-guides/display-on-google-maps/
https://toolset.com/documentation/user-guides/display-on-google-maps/displaying-markers-on-google-maps/
https://developers.google.com/maps/documentation/javascript/examples/event-simple
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 8 replies, has 2 voices.
Last updated by 6 years ago.
Assisted by: Christian Cox.