Sauter la navigation

[Résolu] Edit and style error Google maps position text

This support ticket is created Il y a 3 années et 5 mois. 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
- 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)

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par romanB-3 Il y a 3 années et 4 mois.

Assisté par: Waqar.

Auteur
Publications
#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, lien caché
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

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.
lien caché
Thanks.

#2179905

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: lien caché )

Here is a guide on cookie management in Google Chrome:
lien caché

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!