Skip Navigation

[Resolved] Custom Image as Map Icon/Marker

This support ticket is created 3 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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: Africa/Casablanca (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 3 years ago.

Assisted by: Jamal.

Author
Posts
#2007921
Screen-Shot-2021-04-01-at-9.18.24-PM.jpg

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!

#2008503

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.