I have a view setup displaying a map on a cpt category pages displaying the cpt locations/pins. I'm wondering if it's possible to display, before hover, the cpt name and thumbnail above each pin on the map.
hidden link
Thanks,
Tim
Hi Tim,
Thank you for contacting us and I'd be happy to assist.
If you'd like to open the info windows for all the map markers, automatically, I'm not afraid, it is not supported.
( ref: https://toolset.com/forums/topic/need-to-open-the-infowindow-for-all-markers/ )
You can use custom code to open a particular marker's info window, as discussed in this thread:
https://toolset.com/de/forums/topic/maps-open-popup-on-start-load/
regards,
Waqar
Thanks. But what if I just want the cpt title to appear above each pin. Impossible?
So there's no way to output any of the cpt fields directly on a map, without the hover popup involved?
I would think there has to be some kind of hack that could work, maybe somehow grabbing a snapshot of the google map to use as the background image then layering the cpt data on top of that... ?
Tim
I've performed some research online, but, couldn't find anything relevant on the topic for this customization.
One workaround can be to upload a separate marker icon/image with each post that is shown on the map. This image can be unique for each post that includes the title of that post.
Those images can be then plotted on the map, in place of the default map marker pins.
Thanks. But a separate map marker is kind of unmanageable because there will be eventually be 100s of these posts and I can't make an individual pin for each.
The solution in this post seems close if there was the way to open multiple info windows at once. Is this still not possible?
https://toolset.com/forums/topic/need-to-open-the-infowindow-for-all-markers/
Tim
Yes, I'm afraid, multiple info windows at once are still not supported.
I can understand managing the manual individual marker pin image for each post will result in a lot of ongoing manual work, but, unfortunately, it is the only closest possible workaround that I can think of in this case.
Ok, thanks. I there any documentation on using separate marker icon/images and showing those on the map?
Yes, from the code of the page, it seems that you're using the classic/legacy view to show those map markers.
In your view for this map, you'll have the shortcode 'wpv-map-marker', to render individual map markers:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker
You can pass the URL of the individual map marker image/icon in the shortcode attribute "marker_icon", for example:
[wpv-map-marker map_id="my-map" marker_id="my-marker" marker_icon="URL-of-the-icon" marker_field="wpcf-my-marker"]This is the content of the marker popup.[/wpv-map-marker]
Where you'll replace "URL-of-the-icon" with the actual image/icon URL path.
To make it easier to use, you can register a new image type custom field "Map marker icon" ( slug: map-marker-icon ) and store each post's marker image/icon in that field.
After that, you can call that field's value in the map marker's shortcode, by using the Types Fields API shortcode, like this:
( ref: https://toolset.com/documentation/customizing-sites-using-php/functions/#image )
[wpv-map-marker map_id="my-map" marker_id="my-marker" marker_icon="[types field='map-marker-icon' url='true']" marker_field="wpcf-my-marker"]This is the content of the marker popup.[/wpv-map-marker]
I hope this helps and please let me know if you need any further assistance with this.