Skip Navigation

[Resolved] Map results don't display sorted by distance from search address

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Jim 1 year, 5 months ago.

Assisted by: Waqar.

Author
Posts
#2616315

Jim
Screenshot 2023-06-15 at 9.56.06 PM.png
Screenshot 2023-06-15 at 9.55.18 PM.png

Tell us what you are trying to do?
I have a custom post type that has an Custom Field of type Address. When visitor search by providing an address (or their current location) I want the search results to be displayed sorted by proximity to the address submitted.
Is there any documentation that you are following?
https://toolset.com/documentation/user-guides/display-on-google-maps/displaying-markers-on-google-maps/?utm_source=toolsetmapsplugin&utm_campaign=toolsetmaps&utm_medium=views-integration-distance-filter&utm_term=our%20documentation#filtering-markers-by-distance
Is there a similar example that we can see?
No, I don't know of one, unfortunately.
What is the link to your site?
hidden link

#2616357
distance-ordering-example.png

Hi,

Thank you for contacting us and I'd be happy to assist.

To order the results by the distance from the searched location, the option 'As a distance from' should be selected, as shown in the attached screenshot.

Note: The URL parameter in the ordering settings and the query filter settings should be the same.

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2616459

Jim
Screenshot 2023-06-16 at 7.16.40 AM.png

Hi Waqar.

Thank you very much for your response.

However, I don't have the option to select 'As a distance from' as per your screenshot. That option is greyed out for me. See attached image.

You are likely correct that this is the the problem, but I can't fix it if I can't select that option.

Please help! Why would that be greyed out?

Jim

#2616473

Jim

I have a staging site set up and the same thing occurs. I have deactivating plugins to see if there is a conflict. So far, no change but I haven't deactivated them all.

I turned on debugging in wp-config on and only got Notices such as:
Notice: Undefined index: meta_key in /home/955049.cloudwaysapps.com/aktkxrpugy/public_html/wp-content/plugins/toolset-maps/application/controllers/compatibility/gutenberg/editor-blocks/blocks/map/MapBlock.php on line 918

Notice: Undefined index: meta_key in /home/955049.cloudwaysapps.com/aktkxrpugy/public_html/wp-content/plugins/toolset-maps/includes/toolset-maps-shortcode-generator.php on line 844

These are just Notices so I don't think they are helpful.

Your help is greatly appreciated.

Jim

#2616527

Jim
Screenshot 2023-06-16 at 11.32.40 AM.png

Hi again Waqar.

I think I figured out the issue. There was a discrepancy in the Custom Field slug of the Address.

This brings to light another issue though. My custom type is a Therapist, which people search for. There can be multiple Therapists at the same Business Address. On the map, only one Therapist will show at a specific location/address; they must be exactly overlapping..? Or is the first one replaced?

Is there a way around this? Can I show all of the Therapists at the location on the map?

In the included photo, both Therapists have the same address listed and only the second one will display on the map.

Jim

New threads created by Waqar and linked to this one are listed below:

https://toolset.com/forums/topic/split-map-results-with-the-same-location/

#2616959

Thanks for the update and glad that the issue with the address custom field was sorted.

I've created a separate ticket for your new question and will follow up on that shortly.
( ref: https://toolset.com/forums/topic/split-map-results-with-the-same-location/ )

You're welcome to mark this ticket as resolved and start a new one for each new question or concern.

#2617011

Jim

My issue is resolved now. Thank you!