Hello,
Please help me to find a way to let the user select the filter distance radius. I don't get how to add this filter to my map, I just need to let the user enter or select a distance radius always from the user position and Km only. Both for block map and classic map. See picture.
Thanks
Regards
Nicola
Hello Minesh,
thanks for replying. I wrote to you because I did read those docs, but I couldn't understand why I must set "Should distance center input be required" value to No while I do have other filters active an I should select Yes ? Why can't all filters work together ? also I'm currently using "Distance center is set from user location", I don't understand why it seems I have to use "Distance center is set using URL parameters" instead ....
What am I missing ?
thanks
Regards
Nicola
It's already stated when you select No:
No (use when combining this filter with others)
So, you should select "No" option.
What filters are not working togather?
Can you please share problem URL and admin access details as well as what is your expected results?
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
In the editor you find the view in the second conditional.
On frontend the page works fine, but you probably cannot see anything because of the active geolocation, there are no profiles to display in your part of the world. You can change the address of this profile to any address close to you so that you might then show it on the map enlace oculto
Yes, I can see your address in Paralyzed profile. You should now go to : enlace oculto
and you should see a map with the Paralysed Icon located to your address in India.
Can you ?
ok, I don't know why, I can. However my question was not about the map itself, but about how to add the distance filter that can be set by the user in order to let him change the distance radius from his position, any clue ?
We have wrapped the view "toolset-distance-search-user-location" within the shortcode [wpv-geolocation] so the reults will display once user allow his current location address and that way we will be able to get the user's current location.
Then I've added the following code to "Custom Code" section offered by Toolset with the code snippet namely "toolset-custom-code":
=> enlace oculto
add_filter( 'wpv_view_settings', 'func_show_results_within_user_current_location', 10, 2 );
function func_show_results_within_user_current_location( $view_settings, $view_id ) {
if ( $view_id == 29802 ) {
$user_location_lat_lon = $current_user_lat = $current_user_lon = 0;
/// get current location of user
if(isset($_COOKIE["toolset_maps_location"]) and $_COOKIE["toolset_maps_location"]!=''){
$user_location_lat_lon = explode(",",$_COOKIE["toolset_maps_location"]);
$current_user_lat = $user_location_lat_lon[0];
$current_user_lon = $user_location_lat_lon[1];
}
if ( ! empty( $user_location_lat_lon ) ) {
$view_settings['map_distance_filter']['map_center_lat'] = $current_user_lat;
$view_settings['map_distance_filter']['map_center_lng'] = $current_user_lon;
}
}
return $view_settings;
}
Now, when I check on frontend, it does only show one entry that is belongs to my location.
=> enlace oculto