Skip Navigation

[Resolved] Map location don't work

This support ticket is created 5 years, 5 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 5 replies, has 2 voices.

Last updated by Beda 5 years, 5 months ago.

Assisted by: Beda.

Author
Posts
#1296547

I need to show a form for users in specific area, using this code:

[wpv-geolocation]
   [toolset-maps-distance-conditional-display location='Leblon, Rio de Janeiro - Brazil' distance='50' display="inside" unit='mi']  
      [cred_form form="add-publication"]
   [/toolset-maps-distance-conditional-display]
[/wpv-geolocation]

When user load the page and accept share your location, form don't load.
Can help me?

Other question... How can i set dynamic location (get the current user geolocation).

#1296721

For your other question, please try to open a new ticket, as it is not related to the issue here.

Now, Toolset Forms within Geolocation ShortCodes:
- the simples test here is to remove the Form, and insert some simple text - Does that work?
- if yes, then the Toolset Forms has in issue
- if not, then the Geolocation has an issue

On my local, nothing worked as expected.

1. [toolset-maps-distance-conditional-display] does not work at all if [wpv-geolocation] is not added, and that is just passed as an almost not visible warning in blue on top of the GUI.
In my opinion, this is bad because if we can insert the shortcode (and we can) as a standalone it should either warn properly or insert it for us, simple.

2. all I get is "Your location is needed to show this content.", and even if I say yes in the prompt, for me, it's completely broken - it keeps saying "Your location is needed to show this content." and never reloads the page as it is supposed to according to the DOC:
https://toolset.com/documentation/user-guides/maps-shortcodes/

Something seems to not work as it should here, I am escalating this and will feedback to you how to solve it.

I'll feedback here my findings.

#1296739

OK, I have some findings here.

The chance the ShortCode does not work is as follows:
1. Either you just finished inserting the ShortCode and did not allow yet enough time to propagate the saved data (unlikely)
2. Or you did not allow the browser to share location related to this site.

Then, the cookie won't be set and Toolset Maps will not display anything wrapped within.
I am sure, if you remove the Form and just put a Single text there, it will also fail.

That would confirm the Cookie is the issue.

Please follow as this:

1. Delete all cookies from the browser (you can do that as you delete cache/browser history)
2. Delete The ShortCode (both geolocation and distance condition) from your content
3. Make sure that your Toolset Maps Plugin has a proper API Code set
4. Make sure your site uses a valid SSL (HTTPS) certificate and you navigate the site with HTTPS
5. Make again sure all cookies are deleted, and that any site where cookies are blocked (especially the one you test with) are also deleted from the browser
6. Insert the ShortCode below as a test:

[wpv-geolocation]
  [toolset-maps-distance-conditional-display location='YOUR ADDRESS' distance='1000']
    SOME TEXT
  [/toolset-maps-distance-conditional-display]
[/wpv-geolocation]

That now should, when you load the front end of this page, ask you to allow the location sharing, then it will - if you accept - reload the page and display the "SOME TEXT".
SOME TEXT can, of course, be replaced by a Form, this works as well.

Note, what I noticed locally is that it took a while (approximately 20 minutes) until the cookie was set properly, as in the begin, I saw it not working, and started debugging it until I found the cookie was not set.
I then controlled the Browser Console, and after reloading twice, the cookie was there.
Hence, it started working fine.

Note, this can happen due to cache, isp connections, and others - as we also store the location in specific database tables, so to use them as a cache, I can imagine a certain delay in the first setup - however, after that, it should work flawlessly.

Now, I asked to update the DOC and will discuss the GUI with the Developer, but as per the feature itself, everything is working fine here.
If you cannot confirm this on your site, can you share access, and/or a duplicate of the site?

#1296741

In fact, the cookie is set by session, so you need to close the browser, and re-open, to refresh it.
That might help to solve this problem.

#1299035
Map Distance Short Code.JPG

I need to show a content if the person is inside "X" Km from a given address.

See on the attached image the code I used.

I did the following test:

- the address being retrieved is the address of the hotel NH9Julio,
- I am at now on this hotel.

So, it should show the content, but it is not ...

Beside the form, I added a text to make sure that it is not something related to form. Even that, the text is not presented.

The test was done on the browser all the cookies were delete. The browser asked permission to access the location.

Even that, it seems the [wpv-geolocation] short-code is not work because it should compare my current location with the hotel address, find that I am inside and then show the content.

#1299245

I think it is because you do not use an address, but a ShortCode.
The ShortCode is red highlighted speaking that it's broken due to apostrophes.

Can I gain login data so to try to adjust this directly on your site?
Note, I will need to create a dummy Post to check my local address against - please let me know if this is allowed (I think I can draft it, there is no need to publish it)

Thanks!