Skip Navigation

[Resolved] Adding cpt name and image above map pin

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
- 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: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by Waqar 1 year, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2511877

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

#2512781

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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

#2512799

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

#2513787

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

#2513913

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

#2515479

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

#2515503

Ok, thanks. I there any documentation on using separate marker icon/images and showing those on the map?

#2516139

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

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