Skip Navigation

[Resolved] Edit and style error Google maps position text

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.

This topic contains 4 replies, has 2 voices.

Last updated by romanB-3 3 weeks, 4 days ago.

Assigned support staff: Waqar.

Author
Posts
#2176047

Hi,
I'd like to edit and style error Google maps position text "Votre position est requise pour afficher ce contenu."
Here I have a map getting user location, hidden link
And before he allows (of after he refuses) to share his position, I have this text under the map, that I need to customize.
How and where may I proceed to do so ?
Thanks.

#2176901

Waqar
Supporter

Languages: English (English )

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

Hi,

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

I'll assume that this consent for user location is added using the "wpv-geolocation" shortcode:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-geolocation

This shortcode supports the attribute "message_when_missing" which can be used to add a custom text:


[wpv-geolocation message_when_missing="<span>We need your location to show this content</span>"]
    // content to show when location consent is granted
[/wpv-geolocation]

Please note how I've wrapped the text message inside a <span> tag, so that it can be easily targeted using custom CSS code for styling.

regards,
Waqar

#2177007

Hi,
Thanks,
I've done this and it works, but now I don't have the browser asking for autorisation anymore.

					[wpv-geolocation message_when_missing='<div class="geolocation-message">Pour afficher les points de vente les plus proches, autoriser mysite.tld à connaître votre position.</div>']
						[wpv-map-marker map_id='carte-points-de-vente' marker_id='marker-visiteur' marker_title='Vous êtes ici :)' marker_icon='icon.png' map_render='immediate' current_visitor_location='true']Selon la détection de votre géolocalisation, vous devriez être ici.[/wpv-map-marker]
					[/wpv-geolocation]

Also I notice I have a console error.
hidden link
Thanks.

#2179905

Waqar
Supporter

Languages: English (English )

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

Thanks for the update.

When location sharing has been allowed in any browser, the Toolset stores the user's location in that browser cookie named "toolset_maps_location". After that, you'll not see the request to allow the user location again in that same browser.

To see that approval message again in that same browser again, you'll have to clear the browser cookies for this site and also change the location approval option for the website from "Allow" to "Ask (default)".
( example screenshot from the Chrome browser: hidden link )

Here is a guide on cookie management in Google Chrome:
hidden link

The console error is resulting from this custom script included in the view:


$(".js-wpv-addon-maps-focus-map").click(function() {
    $('html, body').animate({
        scrollTop: $("#js-wpv-addon-maps-render-carte-points-de-vente").offset().top - 100
    }, 1000);
});

You can change all instances of "$" with "jQuery" to fix this:


jQuery(".js-wpv-addon-maps-focus-map").click(function() {
    jQuery('html, body').animate({
        scrollTop: jQuery("#js-wpv-addon-maps-render-carte-points-de-vente").offset().top - 100
    }, 1000);
});

#2180021

My issue is resolved now. Thank you!