Please can you check that in the current "Toolset Maps" plugin (Version 1.8.4) when using the filter:
Show posts within 20mi radius of address/coordinates provided using toolset_maps_distance_center URL parameter.
This is working correctly?
This previously worked in Version 1.8.2 and lower.
The newer version of the plugin doesnt seem to work correctly - I had a map display a location (Shoreditch, London, UK) within 20 miles of the searched area (London, UK) and it wont show up - even when setting the filter radius to be 500 miles!
When searching the location specifically (Shoreditch, London, UK) it would show up
Would be great if you can confirm that this is working correctly please - many thanks
EDIT - not "Shoreditch, London, UK" - example should be "Finsbury Park, London"
additionally when adding the text "&toolset_maps_distance_radius=15" into the url the radius is correct & shows the missing items.....
Hi, I will run a quick test in my local environment and report back to you in a few minutes. Can you provide some additional information? If I'm not able to easily replicate the problem locally this will be helpful:
- Take a screenshot of the Query Filter panel from the View editor screen in wp-admin. Please attach that to your next reply.
- Also in the View editor screen, find the Search and Pagination panel. Copy the code and paste it in your next reply.
- Please provide a URL where I can see the problem on your live site. I'm not clear from your information here which results I should see on the map, and which ones are missing. Please elaborate for me.
Hi, the distance filter does seem to be working for me in a local test. I tried multiple different filter distances starting with 20 and going down to 5 miles, and the results seem accurate at first glance. I'll be glad to take a look at any additional information you can share to figure out what's going on.
Christian, Thank you - I attach the screen grabs you requested.
A live version is available here:
hidden link
When searching the location/address:
1. Location/Address = London, UK
(displays 2 results)
2. Location/Address = Finsbury Park, London, UK
(displays 4 results)
As Finsbury Park is within 20 miles of "London, UK" the search for "London, UK" should return the addresses from "Finsbury Park"
By adding the text: "&toolset_maps_distance_radius=20"
So the address becomes:
hidden link
All results are included as expected (ie 20 miles of London, UK)
Any assistance would be very much appreciated & thank you for your consideration
Thanks for the extra info. I don't understand why the URL parameters do not include toolset_maps_distance_radius when you submit a search. Can you explain briefly how the URL/history manipulation is implemented? Specifically, how the /find-space/ directory is stripped when I submit a search?
Let me explain what I mean in more detail. I start here:
https://www.yoursite.co.uk/find-space/
I type "London, UK" in the Location/Address field and use the places auto-suggest dropdown to select London, UK. Then I click "Submit" and the URL is updated. Not only are the custom search View URL parameters applied, find-space/ is stripped out. Look carefully here:
https://www.yoursite.co.uk/?toolset_maps_distance_center=Finsbury+Park%2C+London%2C+UK&wpv-wpcf-property-status=to-let&wpv_view_count=897
You can see this is now pointing at the homepage URL, not the /find-space/ URL. That type of URL manipulation during custom search submission is not normal, some script is manipulating the URL or history object to achieve this. If I add the URL parameter manually now and click return to refresh the page, no results are shown at all:
https://www.yoursite.co.uk/?toolset_maps_distance_center=Finsbury%20Park%2C%20London%2C%20UK&wpv-wpcf-property-status=to-let&wpv_view_count=897&toolset_maps_distance_radius=20
That makes sense, because again, this is the homepage URL not the /find-space/ URL. So if something is modifying the URL when the search results are updated, I need to understand more about it to confirm it's not stripping the required distance parameter.
ok so that is due to a preloader plugin: https://wordpress.org/plugins/the-preloader/
I have disabled it for the avoidance of doubt - please refresh and try again....
oddly the same thing happens - even with the plugin disabled
If you disabled the preloader plugin and it's still stripping the /find-space/ directory after submitting a search, either some cache is holding on to the preloader plugin files or the preloader plugin is not responsible for modifying the URL in this manner. I'll be glad to take a closer look. Is it okay for me to create a clone of your site and run some tests locally? This way I'm not breaking anything else on the live site during testing. If you approve, I'll log in and create a clone using the Duplicator plugin. Please provide login credentials in the private reply fields here.
hi - the url stripping has been sorted, there was a problem on the SIteground server yesterday that has been fixed & also remedied that issue - i can make a staging site for you if necessary, how do i send you the details so they arent publically available?
I will make private reply fields available here. You can share login credentials in your next reply.
Okay thanks. If you modify the wpv-control-distance shortcode you can show inputs where the User can select the distance radius and units. Here's the current shortcode:
[wpv-control-distance default_distance="20" default_unit="mi" compare_field="map-address" distance_center_url_param="toolset_maps_distance_center" distance_radius_url_param="toolset_maps_distance_radius" distance_unit_url_param="toolset_maps_distance_unit" inputs_placeholder="%%CENTER%%"]
The inputs_placeholder attribute is responsible for managing the display of the input fields. You should include the %%DISTANCE%% keyword to display the radius and unit inputs, along with any other information you want to display. For example:
[wpv-control-distance default_distance="20" default_unit="mi" compare_field="map-address" distance_center_url_param="toolset_maps_distance_center" distance_radius_url_param="toolset_maps_distance_radius" distance_unit_url_param="toolset_maps_distance_unit" inputs_placeholder="Show spaces within %%DISTANCE%% of %%CENTER%%"]
It looks like the distance keyword was removed, perhaps to style the inputs in a single row. I recommend using CSS instead if you want to hide the radius and unit inputs, otherwise the filtering feature won't work correctly. For example, this modification will hide the radius and unit inputs from display, but keep them in place to support the filter:
[wpv-control-distance default_distance="20" default_unit="mi" compare_field="map-address" distance_center_url_param="toolset_maps_distance_center" distance_radius_url_param="toolset_maps_distance_radius" distance_unit_url_param="toolset_maps_distance_unit" inputs_placeholder="<span style='display:none;'>Show spaces within %%DISTANCE%% of </span>%%CENTER%%"]
Try that and let me know if it's still not behaving as expected.
amazing - thank you so much, works like a charm! please let me know if you have a donate/buy you a coffee option as I really appreciate your help on this one 🙂
My issue is resolved now. Thank you!