Skip Navigation

[Resolved] Tooltips for Map Markers

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.

Our next available supporter will start replying to tickets in about 3.06 hours from now. 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: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by clayH-2 1 year, 8 months ago.

Assisted by: Waqar.

Author
Posts
#2560433

I used the Toolset Maps to create a map from a custom CPT. I got the map to display, but I would like the title and address from my CPT to display when I hover the mouse over the marker. Can this be done with Toolset Maps?

#2560639
map-block-settings.png

Hi,

Thank you for contacting us and I'd be happy to assist.

Yes, you can set the content for the map marker's hover and the pop-up event. You'll find these options in the map block's settings, as shown in the attached screenshot.
( ref: https://toolset.com/lesson-placement/lesson-placements-1622939-1620853/#add-marker-pop-up-content-and-hover-hints )

In these fields, you can use the Toolset shortcodes to show the content like the post title and the custom field data:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/
https://toolset.com/documentation/customizing-sites-using-php/functions/

Note: If you're using the map shortcodes for the map and the marker, you can use the 'marker_title' attribute in the map marker's shortcode, to show the content for the hover event:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/

Example:


[wpv-map-render map_id="map-1"][/wpv-map-render]

[wpv-map-marker map_id='map-1' marker_id='marker-1' marker_title='hover event content' marker_field='wpcf-address-field']Popup content[/wpv-map-marker]

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2561187
Screenshot 2023-02-24 at 4.26.54 PM.png

Sorry, but I must be confused as my screen does not look like that at all. Attached is what my screen shows and the map only displays the CPT title. I want the title and the address field.

#2562213

Thanks for writing back.

In the screenshot you've shared, the 'wpv-map-marker' shortcode can be seen that is being used to generate the map markers.
( screenshot: hidden link )

As shared in the example of that shortcode in my last reply, you can include the 'marker_title' attribute, to show any content in the mouse hover state of the marker:

 
[wpv-map-marker map_id='map-1' marker_id='marker-1' marker_title='hover event content' marker_field='wpcf-address-field']Popup content[/wpv-map-marker]

#2562479

I see that, but I do not understand how to get the CPT content to display within the marker_title. I have tried using shortcodes to no avail. What I want it the title of the CPT along with the address field. Please advise.

#2562793

To troubleshoot, why it didn't work, I'll need access to the website's admin area.

Can you please share temporary admin login details, along with the link to the page with this view?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

#2563563

Thank you for sharing the access details.

I've updated the map marker shortcode so that the post title ( [wpv-post-title] ) and the address field ( [types field="retail-address"][/types] ) are passed to the marker through the 'marker_title' attribute:
( screenshot: hidden link )


[wpv-map-marker map_id='map-23' marker_id='marker-[wpv-post-id]' marker_field='wpcf-retail-address' marker_title='[wpv-post-title] - [types field="retail-address"][/types]'][/wpv-map-marker]

You'll now see the post title and the address while hovering over the map markers.

#2563851

My issue is resolved now. Thank you!