Skip Navigation

[Resolved] Show the closest location near me on the search result

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 1 voice.

Last updated by Minesh 1 month, 3 weeks ago.

Assisted by: Minesh.

Author
Posts
#2786727
Capture.PNG

Tell us what you are trying to do?

I have custom post type (Clinics) and there is map showing all locations. On the search bar, I want to show the closest clinic near me on the search result when I search my location address. How can I achieve that?

Is there a similar example that we can see?

Check this example website: hidden link. When you search your locations, the nearest clinic will show.

What is the link to your site?

This is the development site I worked on: hidden link

#2786882

Anybody help me? PLS

#2786906

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

There is no such feature available to restrict the Google map address autocomplete to nearby places.

But you can add some custom code and achieve this, the following is for reference where the Google address autocomplete is restricted to specific country:
- https://toolset.com/forums/topic/split-change-placeholder-text-for-maps-fields-on-a-post-form-map-address-field-limit-to-specific-country-not-working/#post-2676494
- https://toolset.com/forums/topic/limiting-addresses-in-forms-via-js-disables-display-of-map-when-filling-out-form/#post-1856999

More info:
- https://stackoverflow.com/a/30089515