Skip Navigation

[Resolved] Google map labels

This support ticket is created 2 years, 7 months 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 2 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#2156383

for some strange reason labels are not showing on my markers, I've tried "6", '6', 6 etc

[wpv-map-marker map_id="map-8" marker_id='marker-[wpv-post-id]'
marker_field='wpcf-user-address'
marker_icon="hidden link"
marker_label= "6"
marker_title="[types field='display'] [types field = 'aircraft-type'] "]
[wpv-post-body view_template="pilot_popup"]

#2156407

for some strange reason labels are not showing on my markers, I've tried "6", '6', 6 etc
Hello, the attribute marker_label isn't listed as a supported attribute for the wpv-map-marker shortcode, as per the Maps Shortcode documentation available here:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker
Where are you seeing information about this marker_label attribute and how it should be implemented? I will be glad to take a look if you can point me towards that information, as it should probably be corrected since this attribute is not supported.

#2156413

// Adds a marker to the map.
function addMarker(location: google.maps.LatLngLiteral, map: google.maps.Map) {
// Add the marker at the clicked location, and add the next-available label
// from the array of alphabetical characters.
new google.maps.Marker({
position: location,
label: labels[labelIndex++ % labels.length],
map: map,
});
}

per hidden link

#2156417

The code you shared is a direct implementation of the Google Maps JavaScript API, if I'm not mistaken. There is no one-to-one similar feature available for labels in Toolset map markers, so implementing such a label would require custom JavaScript that manipulates the marker objects directly. If you'd like to interact directly with the map marker JS objects created by Toolset Maps, they are available in the JS path here:

WPViews.view_addon_maps.markers['your-map-id']

Replace your-map-id with the ID of the map whose markers you would like to target.

You can request this marker label feature is added to the map marker shortcode, if you'd like to see it in a future release of the software: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

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