Skip Navigation

[Resolved] Distance selection was working, now not working

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


Toolset Maps 1.8 and 1.8.1 require MySQL 5.7.6 and above to provide distance filtering and sorting capabilities to Views.


This is fixed in Toolset Maps plugin version 1.8.2

Relevant Documentation:

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

Our next available supporter will start replying to tickets in about 1.96 hours from now. 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 11 replies, has 3 voices.

Last updated by DavidW2160 4 years, 11 months ago.

Assisted by: Luo Yang.


I am trying to: Use the Views + Maps distance filter

Link to a page where the issue can be seen:
hidden link
hidden link

I expected to see: the same listing(s) on both pages

Instead, I got: the no-filter page shows the listing(s), the filter page does not. The only difference between the two pages is a distance filter from my address in Cottage Grove, OR 97424, and the listing(s) are also in the same city/zip

This seems to have occurred abruptly with the download of the most recent maps plugin (update) and after conversion of the cache.

The filter set within the view also seems to generate a cached address in San Francisco, no matter what address I tell it in the view distance filter. See uploaded image. This should have been 725 E Whiteaker Ave, Cottage Grove OR 97424



Thanks for the details, I can see the problem in your website, the distance filter does not work as expected.
I am trying to duplicate the same problem in my localhost, will update here if there is anything found.


I can get the same result with MariaDB in my locahost, and below error message:

WordPress database error: [FUNCTION wordpress.ST_Distance_Sphere does not exist]

The function ST_Distance_Sphere() was added in MYSQL 5.7.6:
hidden link

but you are using MySQL 5.5.5, so it conducts the problem.

According to our document:
The minimal requirement is: MySQL 5.6 and above.

So it should be a bug of Toolset Maps plugin, I have escalated this issue, will update here if there is any news.


Here is the feedback from our developers:
We are working on it. Currently, please try these:
1) Backup your website
2) Downgrade to Maps 1.7.4, no data should be lost and things should continue working as before
You can download it here:


I can't vouch for the accuracy of this post, but there's a potential replacement function for MariaDB users like us:

CREATE FUNCTION `st_distance_sphere`(`pt1` POINT, `pt2` POINT) RETURNS
return 6371000 * 2 * ASIN(SQRT(
POWER(SIN((ST_Y(pt2) - ST_Y(pt1)) * pi()/180 / 2),
2) + COS(ST_Y(pt1) * pi()/180 ) * COS(ST_Y(pt2) *
pi()/180) * POWER(SIN((ST_X(pt2) - ST_X(pt1)) *
pi()/180 / 2), 2) ));


Thanks for the link, I have shared it with our developers.

And we have add a new errata for this issue:


I can confirm that I'm having this same issue on hidden link

Location filters worked when I initially developed the site, but after updating the Toolset Maps plugin, I found that they no longer function as they once did.

Update: I can also confirm that the previous version of the Toolset Maps plugin allows the distance filter to operate. I just dialed it back now. Will wait for the next release before updating again.



Here is the feedback from our developers:
This is fixed in Toolset Maps plugin version 1.8.2, it is under QA status, will be released soon.

And According to our document:
The minimal requirement is: MySQL 5.6 and above.

So you will need to upgrade the MySQL server to 5.6 or above.


I have just confirmed that version update 1.8.2 fixes my problem. Give them my thanks!


Thanks for the confirmation.


1.8.2 fixed this issue for me. Thank you!


My issue is resolved now. Thank you!

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.