Skip Navigation

[Resolved] Use my Location not working

This support ticket is created 6 years 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by Nigel 6 years ago.

Assisted by: Nigel.

Author
Posts
#1140139
view-use-location.PNG

I am trying to: List custom post types, and use the 'Use My Location' feature with Google Maps

Link to a page where the issue can be seen: /therapist-search/

I expected to see: I see the button.

Instead, I got: But the button doesn't work, nothing happens when you click 'Use my Location'. The other features of Google Maps work normally.

#1140317

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Mark

It is a browser security limitation that the Use My Location option only works on https:// sites, and it seems like you have an insecure http:// protocol site.

Which raises a usability issue, as you shouldn't be presented with that option when it cannot work.

It wasn't available with earlier Maps versions (I just checked), but somewhere the test for https:// before displaying it seems to have been lost.

I'm escalating this as a usability issue: you shouldn't see that option except on https:// sites.

#1140431
my-location-coords.JPG

Thanks Nigel - this makes sense, and I tested this on the production HTTPS version of the site, and it works as it should. Appreciate you clarifying.

When I tested it, it works just fine. Visually it returns the latitude/longitude in the field, and I am looking for a 'nicer' way to present this: perhaps with the closest street address, or showing the 'city, province code'? Any ideas around this, or know how else it has been done, and how to do that?

Thanks,
Mark

#1140451

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

The location is provided by the browser using the web Geolocation API (hidden link).

That returns the coordinates, not an address, so that's what is included in the search field.

If you wanted to display an address you would have to write a custom solution which used the Google API to convert the coordinates to an address, and displayed that address in place of the coordinates (which would still be required, and which you would hide with CSS).

#1140461

Thanks a ton Nigel - I will see if I can tackle this, and update here with how I turn out.

Cheers,
Mark

#1141342

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

OK, let me mark this as awaiting feedback from you.

#1142951

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

FYI Mark we added an erratum with a patch for the issue of the Use my location button appearing on http:// sites when it shouldn't: https://toolset.com/errata/toolset-maps-is-providing-current-user-location-as-search-criteria-on-http-websites/