Skip Navigation

[Resolved] User location marker AFTER click on the button "Use My Location"?

This support ticket is created 5 years, 9 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 11 replies, has 3 voices.

Last updated by Beda 5 years, 8 months ago.

Assisted by: Beda.

Author
Posts
#1005483
Marker after button Use My location?.png

Hello Support!

Does it possible to get user location marker on the map only AFTER user's click on the button "Use My Location"?

It is a little bit irritating and annoying to ask site visitors immediately after uploading the site (automatic by a browser), for the location.
Nobody likes it, but it's nice to have the ability to see user position on the if he wants to ...

Thanks in advance,
Sinisa

#1069105

Hello,

There isn't such a built-in feature within Toolset plugins, if you agree, we can create a feature request for it, our developers will evaluate it.

#1069259

Of course, it would be much better...
User experience is such that people don't like direct asking for their location after loading of a page...
Now there are two options when user location will be displayed or when to add a user location marker, so this should be the third option (after click on "Use My location" button).
Thank you!

#1070027

The setting is related to the marker.
It is not possible to be set when you do not use HTTPS and hence cannot ask the visitor to share his private data.
So, if you select this settings, it is A) safe to use and B) not possible to disable, as it is set now.

The marker is usually inserted as a unique marker just for the single visitor, and all other places on your website are usually displayed by OTHER markers.

So, we could theoretically allow what you refer to, but, it is not possible because:
- when you visit a site and want the visitor to see the marker of his location, no matter when, we need to:
-- get that data
-- produce a marker with position
-- render it on a map

If we first render the map, and then render the marker for the current user, only after he/she uses the current location button, we must hence get data that ... we either already have (and hence the request to use the victors location) or have not, and cannot get and show, unless we repeat that process of getting the data, producing the marker, putting it on a map and displaying it.
At least AJAX updated views will have huge issues with this, and I believe "normal" views as well do not profit from it in terms of experience.

Another solution can be to provide 2 Views.
One for users which accept and other that do not.

I think this is a decision that needs to be made when you create the output of the map.
Do you want your users to see that pin, then they have to submit the data.
If you want your users to have an option, offer them a second, minimalist View, where they do not have to share data, but as well will not see any such data.

#1070363
User location marker option.png

Hello!

Hm, I think my site is on https... I mark checkbox in this form to the previous version of the site, with old http but now is https...
And of course, those other markers are related with other metadata...

Also, there is not more than one user in the same time on the same map or computer... This is only current visitor location, and there are no other users visible as markers from one user/visitor experience...

I don't understand completely your explanation why won't be possible... But obviously is related with the browser in start when ask for the location ( in fact, browser ask for such data)...
Ok If it is not possible such option... I've imagined that just as another option for the user location marker (see screenshot)...

P.S.
In my case, user location after approving won't be displayed for Firefox browser... Works normal on Chrome...
Thanks,
Sinisa

#1071350

I do not understand what you mean.

Wether or not you are using HTTPS is visible in the URL your site produces, the protocol it uses, the database values, and more.
It is a decision - made when you setup a site.

So, I suggest to clarify this with your Server Admin if you are not sure, but I can tell you do not use HTTPS - at least, not in the site you asked support for, I see this in the information of the ticket.

Maybe the Screenshot you show me is from another site or you provided us the URL with HTTP only - that is entirely possible.

It is however not related to what I stated.

HTTPS, when you require a user location, is a must.
As soon you want a user to share location, HTTPS is a must
And as soon you want the user's location, asking him/her is a must as well.

Now, to have a Map, that shows (initially) no user' location - hence doesn't nag the user, I suggested to do this:
- provide 2 Views

One, is without the whole "share location" features.
The other, provides those features and asks for permission.

Now, you can for example link mainly to the page with the View that hasn't any location feature turned on that requires the user to accept.
Then, just provide a simple link. in the Search section, where the user, if he/she wants, can click and it leads to a new page.

That new page now is using a view as per the location features, and asks for permission.

Is that a viable solution for you?

It is the only, right now.

I can file such a request but for the given reasons, may be this cannot be done.

#1071454

Hello Beda!

To clarify, Please does it secure "https" is in use at my site (still developing BETA)?
hidden link
I have user location since the site is on https...

At first, my site was at http, so that is the reason why submitting support ticket offers only http, but if you click on such link it should open a website with https...

Another thing, a site with two homepages, I think is not a good option, but of course I need to try then I'll know (two views etc.)
Let it be as usual for now...I can handle as it is for now...
I just asked is there some simple solution to have location after click on "use my location"...

Thank you in advance!

#1072466

The link you shared uses HTTPS, you can see it in the very link and when you load that page in a Google Chrome Browser, you can see it is a safe certificate.

Interestingly the URL provided by debug of this ticket, wasn't using SSL, but it does not really change the situation anyway.

Since you plan to use that on a homepage, it is even more important to understand the need for this nag.
Your visitors must know you are listening to their data. They have to approve/disapprove.

If they disapprove, you get actually exactly what you would want to load "by default":
No location on the map plotted.

But the intention of that Map is to plot such location, hence, it must ask first, on load of the map.

That is why I propose the solution of loading a Map that does not use current location, but offers that option.
That, can then lead to another page with map, not an actual "second Homepage" but a more advanced map.

If your sole purpose is to actually put the users location on the map, why should the user opt out of that?
What do you plan to display or provide else?

Maybe we can find another solution or idea for the homepage.

I assume you want some sort of "you are here" map on the homepage?

This definitely requires a allowance from users and it makes total sense to ask this immediately on first page load.

It is what every app and site does, after all.
First they ask permission, then they bring on the stuff.

Please correct me if I see this wrongly, I am of course open to file this as request, I just do see some issues as outlined with it.

#1073493

I understand what you want to say, and everything's fine. No problem...Through time I will find a solution with two views according to your suggestion (advanced map etc.). Until then I have other jobs to be done before... This belongs to additional things... ?
My question was: Is it possible to get a user's location query only after clicking on the "Use my location" button?
The browser only then will ask for permission to do so, to put user's location on the map.
Now if we want to use user location on some map by default, the browser immediately asks for permission during page loading.

It can be tiring for users, and often users abandon such sites because of such direct demand for their location ...
So I just wanted to have browser's user location request AFTER clicking on the button "Use my location", to bring a clearer visual picture to a user, according to their entered data (distance, location-in that case user location) for that chart. idea was to get a map which shows where is he, and what is around them on entered distance.

I hope now you understand better what I mean. My English is not so well..
But, thank you very much for your effort and explanation of how to get what I want, I 'll try...

#1076092

Yes, sure.

When you insert a marker, that uses the user's current location as it's position, then you need to have the user's location, to display that marker.

When you choose "The location of the current visitor" in the marker GUI, you do have 2 options.
- Render the map immediately and then add visitor location.
- Wait until visitors share their location and only then render the map

If you choose the first, the map renders, and a Browser pop up asks you if you want to share the location.
If not, The Map renders.
That, cannot be changed.

You need to ask that user if he/she wants to share, if not, you cannot display his/her location.

If you instead choose the second option "Wait until visitors share their location and only then render the map", you will not even see the map if you do not share location.

So, I think the first is what you need.

If you need a Button that enables that pop up (so at first the map loads empty, as if there would be no location at all and then only there is a possibility to "show my location"), then you can do this simple HTML conditional trick:

1. Create a Page or View where you display your map and insert the Map + Marker
2. Create a simple HTML button to load the Page again, passing a new URL parameter, and insert it in the Editor so you can see it in the front end later
3. Wrap the marker into a Condition, that checks on the URL parameter passed in above button. If that one is "xy", you show the marker.

The front end, will show an empty map and no nag about sharing location.
There will be a button, if pressed, the user will have to share location (will be asked to)

Here the complete code, that you can use for example on a Content Template, post or else:

<form>
<input type="button" value="Show my location on map" onclick="window.location.href='<em><u>hidden link</u></em>'" />
</form>

[wpv-map-render map_id="map-id"]

[wpv-conditional if="( '[wpv-search-term param="share"]' eq '1' )"]
  [wpv-map-marker map_id='map-id' marker_id='marker-id' map_render='immediate' current_visitor_location='true']
  [/wpv-map-marker]
[/wpv-conditional]

I think that even solves the feature request - right?

#1077547

Hello!

Wow Beda, this is excellent! Thank You very much! This solves the problem very easy with such "mid-button!" Super Idea!
I'll try this in the next few days... So I 'll leave this ticket open to inform you how it goes and to show you results...
Thanks once more for such dedicated support!
Regards,
Sinisa

#1078301

OK, please let me know 🙂

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