Hello
I was able to show the map using views.
With this code
[wpv-view name="list-of-apartments" toolset-maps-distance-value origin_source='url_param' postmeta='wpcf-map-apartments' postmeta_id='$current_page']
I was trying to filter a view but it doesn't work.
Following this info https://toolset.com/forums/topic/show-posts-close-to-the-current-one/ same problem
Can you help ?
KR
Stefano
Dear Stefano,
I assume we are talking about a custom address field "map-apartments", if it is, please try to modify the view's shortcode as below:
[wpv-view name="list-of-apartments" mapcenter="[types field='map-apartments' output='raw'][/types]" cached="off"]
And test again
Hi Luo
It doesn't work for me, still show all the map.
When I select Distance center is set using a fixed location is working fine, but when I select Distance center is set using shortcode attribute (mapcenter) no.
Please check this:
Edit the post view "list-of-apartments", in section "Query Filter", find and edit the distance filter, make sure you are using below option:
Distance center is set using shortcode attribute: mapcenter
See screenshot: mapcenter.JPG
Yes, I'm using that option from the beginning, but it doesn't work
The problem you mentioned above is abnormal, please check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again
2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/
3) 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/
The database dump file you provided above is not valid, it links to a 404 page, it might be a file size problem.
You can put the duplicator package file in your own google drive disk, and share the link only. Private message box enabled again. thanks
Thanks for the details, I am downloading the files, will update here if there is any finds.
I can install the package file, here is what I found:
1) There isn't plugins folder in the duplicator package you provided above, so I have installed the Toolset Blocks + Types + Maps plugins
2) Edit the post "apartment test", I don't see how and where do you setup the map shortcode, and your custom address field is using slug "map-apartments", it is not "Map-apartments", the custom field slug should be in lowercase, so you can display the address value with below shortcode:
[types field='map-apartments' output='raw'][/types]
And display the view shortcode like this:
[wpv-view name="list-of-apartments" mapcenter="[types field='map-apartments' output='raw'][/types]" cached="off"]
In my test, it returns result: No item found.
And if I change the distance filter range to 100 km, then it returns all other 4 apartment post links.
Hi Luo
Thank you for your help.
IMO there are few problems in Toolset, the main problem with maps is the cache.
If I upload a new item, the map is displayed correctly, but if I visit another item, the results of the map do not change, if I add a new one, the problem is solved again.
Do you have a similar experience ? Is this normal ?
KR
Stefano
It works fine in my localhost, how do you display the map shortcode in the "another item"?
Please check this:
In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020.