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.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
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)
Este tema contiene 8 respuestas, tiene 2 mensajes.
Última actualización por hace 6 años.
Asistido por: Christian Cox.