Tell us what you are trying to do?
I have a custom search/filter view set up for locations and providers. I need to filter posts by distance from the user's entered value if the user enters a value. Right now, when a user enters a location value, the posts get sorted alphabetically.
Is there any documentation that you are following?
No.
Is there a similar example that we can see?
Not sure. I've read a bunch of examples but couldn't find a solution to my particular case.
What is the link to your site?
hidden link and hidden link
Hello,
In order to setup sorting by distance, it needs classic editor, for example:
1) Dashboard-> Toolset-> Settings-> General:
in section "Editing experience", enable option "Show both the legacy and Blocks interface and let me choose which to use for each item I build", refresh your browser
2) Dashboard-> Toolset-> Views
Create a post view, in section "Ordering", you sort the result by distance, see my screenshot distance-order.JPG
More help:
https://toolset.com/course-lesson/filtering-and-ordering-map-markers-by-distance/
Hey Luo, thank you for your response. I think that what you suggested will work, but I only want to order by distance when an address is entered. Can I give you login access to the site and have you confirm how this could work?
OK, please provide your website credentials, also point out the problem page URL and view URL, thanks
Thanks for the details, I can login your website, will update here if find anything
I have tried the URL you mentioned above:
hidden link
The distance filter does not work.
Please check these:
Dashboard-> Toolset-> Settings-> Maps
in section "Google Map API key", click button "Check API", I see below error message:
REQUEST_DENIED - This API project is not authorized to use this API.
For the question "I only want to order by distance when an address is entered".
There isn't such kind of built-in feature, "order by distance" setting will override all other orderby settings, and if you use "order by distance" setting, you will not setup other orderby setting, it is a limitation of Toolset Maps plugin, you can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Our developers will evaluate it.