Skip Navigation

[Resolved] How to show posts within a radius of a search location

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to show markers on a map within a radius of a search location.

Solution:
In your View that displays a map include a distance filter.

Use the New Filter button to insert the distance filter: https://toolset.com/documentation/user-guides/display-on-google-maps/displaying-markers-on-google-maps/#filtering-markers-by-distance

This support ticket is created 6 years, 10 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.

Our next available supporter will start replying to tickets in about 0.81 hours from now. Thank you for your understanding.

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 14 replies, has 2 voices.

Last updated by sahrf 6 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#605429

I am trying to: I am trying to set up a view that takes the current location of the user and shows a 5 miles radius of all the experts close to the user.

Link to a page where the issue can be seen: hidden link

I expected to see:

Instead, I got:

#605436

Nigel
Supporter

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

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

Hi there

Does your Google API key have a URL referrer restriction in place?

The issue of markers not displaying is almost always because of problems with how the whitelisted referrer is specified.

Could you first double-check that. If you have a referrer restriction I suggest you temporarily remove it so that the API key is not restricted, and then test again.

Let me know and we can continue if needs be.

#605448

How do I check if Google API key have a URL referrer restriction in place

#605454
image.jpg

I have attached an image for API and Services. Not sure if this is right.

#605456

Nigel
Supporter

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

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

That's the right place.

Your URL referrer restriction should look like the example, e.g.

*.melaninbeauty.co.uk/*

#605457

I have added that to the API credential

#605459

Nigel
Supporter

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

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

And presumably it is still not working?

Could you try removing the restriction altogether and test so we can isolate if the problem is coming from the referrer restriction or if it is something else.

#605468

I have set the the restriction to None.

#605477

I have create a login for yourself if you require it

#605486

Nigel
Supporter

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

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

If the referrer is okay then it looks like the set up of your map may be wrong where the markers are inserted.

I'll mark your next reply as private to get credentials from you if you want me to look at it.

What is the name of the View used to add the map?

#605499

Nigel
Supporter

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

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

I took a quick look at your site and see the map markers are not working, but it is not immediately obvious why.

I made a test View ("Supporter Map") and added it to this page: hidden link

There it works fine.

I'll take a closer look at your View to try and understand the problem, but it will be tomorrow before I can reply again.

#605501

OK

#605505

it's now working, now how do set the current location of the user and shows a 5 miles radius of all the experts close to the user?

#605648

Nigel
Supporter

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

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

For that you need to insert a distance filter, much like you inserted the expert categories filter.

Use the New Filter button to insert the distance filter: https://toolset.com/documentation/user-guides/display-on-google-maps/displaying-markers-on-google-maps/#filtering-markers-by-distance

#606681

Thank you my issue has been resolved