Tell us what you are trying to do?
I believe in views you could use a custom image as a map marker so that each marker could be a unique image and pull from a custom image field. Is something like this possible now that you suggest using blocks?
We are looking to create something like the attached screenshot. Is this still possible using blocks and maps?
Thanks so much for your time!
Hello and thank you for contacting the Toolset support.
Yes, it is possible, but not entirely within blocks. The marker setting on the map block does not allow customization of the marker per each post. But you can work around it using shortcodes. First, remove the marker from the Map block settings in the right sidebar, then add it using a shortcode inside the view's loop.
With shortcodes you can customize the marker per post. Let's say you want to display the featured image as the marker, you can achieve it with a shortcode like:
[wpv-map-marker map_id='my-map' marker_id='marker-[wpv-post-id]' marker_icon='[wpv-post-featured-image size="thumb" output="url"]' marker_field='wpcf-location'][/wpv-map-marker]
This code assumes that:
- The map ID is "my-map"
- The address field slug is "location".
Notice the use of output="url" in the featured image shortcode.
Read more about Toolset shortcodes here:
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/
- https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/
I hope this helps. Let me know if you have any questions.