Skip Navigation

[Escalated to 2nd Tier] Many issues with map and distance filter block

This support ticket is created 2 years, 8 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 – 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 25 replies, has 2 voices.

Last updated by Luo Yang 1 year, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2306751
distance.png

Hi
as you can see from the attached image, the distance filter block renders quite strangely, I don't understand why. I tried to wrap a container around it (red border) trying squeeze the line height, but saw no changes. There are no ways to arrange this as I can see, pls suggest.
Other issues:
- applying margins to the distance filter block the margin is applied to all fields insted of to the entire block
- translation: labels of this block cannot be translated and even accept formatting. Distance label appears translated in edit mode but not on page rendition.
- if in Field settings I select KM, a KM label should be displayed. Instead a selection KM/MI is shown, this is not needed. How to hide it ?
- don't know how to customize single markers in a map block sourced by a view block on the same page (as shown in your video here: https://toolset.com/course-lesson/displaying-a-list-of-posts-on-a-map/) while I managed to do it beautifully in a map sourced by a traditional view, applying conditionals to the markers in the loop. It looks like in a map block there is no way of applying conditional markers, pls explain if this is possible

I tried to apply some CSS you suggested to resize the fields, but they also act on other search fields in the form because they all belong to the same classes, not a viable option.

Thanks

Regards
Nicola

#2307301

Hello,

It is a CSS issue, please provide a test site with the same problem, fill test site credentials in below private message box, I need a live website to test and debug, thanks

#2307405

Q1)applying margins to the distance filter block the margin is applied to all fields insted of to the entire block
It seems to be a CSS conflict issue, you can use CSS attribute selector to style only distance label, for example:

label[for="distance"]{
// Here setup your custom CSS CODES
}

More help:
hidden link

Q2) If in Field settings I select KM, a KM label should be displayed. Instead a selection KM/MI is shown, this is not needed. How to hide it ?
You can hide it with CSS codes, for example:

select[name="toolset_maps_distance_unit"]{
display:none;
}

Q3) don't know how to customize single markers in a map block sourced by a view block on the same page (as shown in your video here
It is possible to setup the marker shortcode manually, for example:
1) Find the map block, disable the source from view
2) In view's loop, display a shortcode block, in this block setup the wpv-conditional codes, and display the marker shortcode:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional

Q4) translation: labels of this block cannot be translated and even accept formatting. Distance label appears translated in edit mode but not on page rendition.

I can see the problem in your website, trying to duplicate the same problem in my localhost, will update here if find anything

#2307649

Hi
Q1 - ok, will try that
Q2 - ok, but if I hide it users won't know that those are Km. No way to fill a "KM" label in between.
Q3 - it worked perfectly, thanks
Q4 - ok, waiting

Also in block distance I didn't find the way to set "Show posts within 50km radius of the viewing user's location." instead of the distance form, like in the classic view filters, pls let me know where is that option, thanks

#2308149
distance4.jpg

Q2) ok, but if I hide it users won't know that those are Km. No way to fill a "KM" label in between.
There isn't such kind of built-in feature, you might consider to use custom JS codes to fill a "KM" label.

Q5) "Show posts within 50km radius of the viewing user's location."
You can find and select the view block, in section "QUERY FILTERS", change the distance filter to what you want, see my screenshot distance4.JPG

#2308503

Q2 - ok but that's outside of my abilities ...
Q5 - thanks, I found the Query filters, but when I try to select the last radio button "Distance center is set from user location" clicking with the mouse nothing happens, the button can't be selected, it looks like the last button is placed outside the form space, please try yourself in the Toolset page

#2309959
distance-filter3.JPG

q5) Thanks for the feedback, I can see the problem in my localhost, it is a CSS issue, please try these:
find and edit the CSS file of Toolset Blocks plugin "toolset-blocks/embedded/res/css/views-admin.css"
replace line 1231 from:
position: absolute;

To:
/** position: absolute; **/

Clear your browser cache, and test again. See my screenshot distance-filter3.JPG

#2310165

Q5 - I did what you suggested and I can now select the radio button, but when I click on the Save button nothing happens and the filter isn't saved even though I update the page.

Also, I have noticed the following: I currently have 6 profiles on the map. If I use the standard markers, the spiderfied markers are 6, while if I add conditionals to customize markers spiderfied count is doubled ! where there is one marker, 2 is shown. I suppose that the spiderfy counter counts 2 markers (standard + custom) instead of the custom only. I don't know if this belongs to the filter issue or it's a different one

thanks

#2310463
gap.png

Q3 related - FYI I found another issue (solved) related to the conditional markers in the shortcode you might want to know. I was struggling to understand why there was a big row gap between the output lines, even if the the row gap is set to 0. I investigated in the browser and as you can see in the attached image the conditionals in a Shortcode block would generate lots of <p> tags that don't have any reason to be there. I checked that removing the conditionals all Ps would disappear. It looks like the conditionals generate Ps while looping, even though there are no Ps in the conditionals. I have solved the issue placing the conditionals in a Custom HTML block instead of in a shortcode block.

#2311053

Thanks for the feedback, I can duplicate the problem in my localhost, and have escalated this issue, will update here if there is anything news.

Currently, please create the post view with legacy view, and setup the distance filters.
https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/

#2312989

Hi
I replicated my view as legacy, but it seems that there is something wrong in the distance filter. I have 6 fake users, I have positioned 2 of them very far away (> 50 km) from my position to see the distance filter to show only 4 of them within 50 kms from my position, but the view always shows all of them. I thought that there was some kind of conflict with the other views on the page so I duplicated the page (home2) and removed all other views but still face the same issue. Then I noticed that in Preview mode the distance filter works (4 users found !) while in page view mode it doesn't (same on both pages, with or without other views). Please feel free to try yourself. Can you explain this ? thanks

#2313963

The filter by user's location, needs to know user's location first, but your website does not popup the message box that ask for location permission.

So the problem is abnormal, please check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme 2021, deactivate all custom PHP/JS code snippets, and test again
2) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#2316233

Thanks for the details, I am downloading the files, will update here if find anything

#2318153

Hi Luo Yang,
please update me about your findings, I need one of the two versions (classic or blocks) to work otherwise my site is stuck, thanks
Regards
Nicola

#2318217

I can install the duplicator package in my localhost, but I am not sure which one is the problem page and post view.

Please try to put [wpv-geolocation] shortcode into your post view, for example:

[wpv-geolocation message_when_missing="We need your location to show this content"]
    // Everything inside will only render when the location is saved and will have that location available on backend
[/wpv-geolocation]

It should be able to trigger the message box for asking the visitor location, see our document:
https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-geolocation

And test again