Skip Navigation

[Resolved] Order view by distance after giving in current location

This support ticket is created 2 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 replies, has 2 voices.

Last updated by wesselK 2 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#2302075

Tell us what you are trying to do?
I am trying to order my view by distance when a user inputs his/her location.

Is there any documentation that you are following?
Not a this moment, I found some stuff about filtering by distance but not ordering.

Is there a similar example that we can see?
No

What is the link to your site?
Current working on a development website, the view can be found here: hidden link

#2302163

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Wessel,

Are you trying to do the order by distance in a block view ?

If so then I recommend taking a look at our erratas page below as this is a known issue.

https://toolset.com/errata/order-view-results-by-distance-not-available-in-blocks/

Please let me know if this helps.
Thanks,
Shane

#2304817

I will use this workaround then. Thank you for your help!

#2304911

One more small question.

I just remade my view in the legacy builder, and now I want to have a map that displays all the (non-filtered) location.
But when I use the builder, it says there is no view to connect the map with.

Could you tell me what I am doing wrong here?

#2304929

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Wessel,

This usually occurs when there isn't a view on the page to populate the map.

Are you loading the view using the View block ? Secondly was this view that you've created to show the unfiltered locations created in Blocks ?

For the map to work there must be a view block on the builder that can be used to connect the map to the addresses.

Thanks,
Shane

#2304931

I am currently not using a view block, but the legacy view (as you instructed above).

Is there no way to connect a map block to a legacy view?

#2305161

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Wessel,

There is however if you provide the markers in your view with the ID of the map that is on the page.

Is your legacy view currently displaying a map ? What I mean is that you using the map shortcode in your legacy view ? If not then you can use the Fields and Views button in the view to add the map inside the legacy view and then add the markers shortcode as well.

Please let me know if further clarity is needed and we can take it from there.

Thanks,
Shane

#2305651

I got it all working. Thank you again!