Skip Navigation

[Resolved] I’m trying to create a view that sorts by location. How do I do this?

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

Problem:

When I click "New Filter", I don't see the "Toolset Maps" section with the distance button below it as an option. Should this be there by default or do I need to do something else?

Solution:

Please check these:

https://toolset.com/forums/topic/im-trying-to-create-a-view-that-sorts-by-location-how-do-i-do-this/#post-1535095

Relevant Documentation:

https://toolset.com/documentation/user-guides/maps/display-on-google-maps/filtering-and-ordering-map-markers-by-distance/

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by Dee_DeeA2948 4 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#1534959

I'm trying to create a view that sorts by location.
I found this article:
https://toolset.com/forums/topic/distance-filter-location-filed-not-working-on-firefox-safari/

I clicked "New filter", but I don't see the "distance" button, as the article states. Can you send me a screenshot? Or help me figure out where I'm going wrong?

Thank YOU

#1535095
distance-filter.JPG

Hello,

For the problem: I don't see the "distance" button.

Are you using block editor to create the view?

The "ordering the result by distance" feature does not avaiable in block editor, you will need to try lagacy classic editor, for example:
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".

Then create the post view with lagacy way: Dashboard-> Toolset-> Views, follow below document to setup the location filters and order the result by distance:
https://toolset.com/documentation/user-guides/maps/display-on-google-maps/filtering-and-ordering-map-markers-by-distance/

And here is the screenshot for "Distance" button.

#1537767

Hi Luo. I followed your instructions. When I click "New Filter", I don't see the "Toolset Maps" section with the distance button below it as an option. Should this be there by default or do I need to do something else? I see many other buttons available, but not the one that I need (Distance).

#1538137
add-field.JPG

It is abnormal, please check these:

1) Make sure you have setup the Google map API
https://toolset.com/documentation/user-guides/maps/display-on-google-maps/creating-a-google-maps-api-key/

2) Make sure you have setup the custom address field in your website:
See screenshot add-field.JPG
https://toolset.com/documentation/user-guides/custom-content/using-custom-fields/

3) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, and test again

4) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and view URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1540029
Screen Shot 2020-03-04 at 9.57.20 PM.png

It appears that the functionality works-- but the appearance sucks. See attached image. Is there any styling I can apply? I tried looking at a few articles and applying the styling, but there were no visible changes.

#1. https://toolset.com/forums/topic/styling-the-distance-filter/
#2. https://toolset.com/forums/topic/style-map-distance-filter/
#3. https://toolset.com/forums/topic/styling-the-distance-feature-of-toolset-maps/

THIS IS THE STYLING THAT I HAVE APPLIED:
[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="form-group">
<label>[wpml-string context="wpv-views"][/wpml-string]</label>
</div>
<div class="form-grouphorizontal"><font color="white">Search by Location (Press Enter to Search)</font>[wpv-control-distance distance_unit_url_param="toolset_maps_distance_unit" distance_radius_url_param="toolset_maps_distance_radius" distance_center_url_param="toolset_maps_distance_center" compare_field="address" default_distance="20" default_unit="mi"]
</div>
[wpv-filter-submit output="bootstrap"]
[/wpv-filter-controls]
[wpv-filter-end]

I don't know if there's anything that you can do to help point me in the right direction?

Thank you for your help!

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

https://toolset.com/forums/topic/style-distance-filter/

#1540055

I assume the origial question is resolved, according to our support policy, we prefer one ticket one question.

for the new question: but the appearance sucks, please check new ticket here:
https://toolset.com/forums/topic/style-distance-filter/

#1540801

My issue is resolved now. Thank you! I appreciate the step-by-step instructions. I was able to follow the steps without any problems.