Skip Navigation

[Resolved] Maps API

This support ticket is created 3 years, 2 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: Africa/Casablanca (GMT+01:00)

This topic contains 4 replies, has 2 voices.

Last updated by ilonaB-2 3 years, 2 months ago.

Assisted by: Jamal.

Author
Posts
#2168849

Tell us what you are trying to do?

- I don't want to show a map on my website, i just want to be able to add a distance filter to my searchbar. So if a users types in his own zipcode and chooses a max distance of 20 km -> all businesses within that distance will be shown on the results page.

Is there any documentation that you are following?

- Just the toolset documentation

Is there a similar example that we can see?

Yes, the website: hidden link has that same option.

What is the link to your site?

- hidden link

#2168877

Hello and thank you for contacting Toolset support.

No need to have a map in order to perform a distance search. Just create the view and add the distance search into it. Check our tutorials and videos on how to create custom search forms here https://toolset.com/related-lesson/custom-search/

If you encounter any issues, let us know what steps we can follow to reproduce them and we'll do our best to help.

#2169037
Image - Custom search Distance.png

Hi Jamal,

Thanks for your quick respons!

What you mention worked, so thank you for that.
I do have some other questions regarding this subject:
- In the search results i'd like to have the post that is nearest to the users, filled in, location to be shown first and the same for the next results. Is this possible and if so, how do i do this?
- Also i'd like to know if it's possible to show the distance in each search result.

- Right now the Custom Search Filter has the text: “Distance show results within” and “of”. (see attached image)
How can i change that text to Dutch? Since my website will be in Dutch..
- How do i change the text: "Enter a location" -> to Dutch? (see attached image)
- Also there is a button with "My Location"-> "Mijn Locatie". Is it possible to hide that button? (see attached image)

- Preferrably i'd like to have the searchbar with all fields on one horizontal line, what is the best way to do this (since the distance search looks like attached image).

Thanks in advance!

#2171789

Hello and my apologies for the late reply, but I do not work on Wednesdays and Thursdays as you may check on my profile page https://toolset.com/forums/users/jamal-b/

Thank you for your feedback! I am glad I could help. However, for support rules, we are able to handle only one issue at a time. This helps us to bring you a better service and also helps other users to find all the information here exposed. For that reason, I'll try to briefly answer each of your questions and if you need further assistance, please open a new thread and ask for me if you want me to continue with you. Otherwise, any other supporter will do his best to help.

- In the search results i'd like to have the post that is nearest to the users, filled in, location to be shown first and the same for the next results. Is this possible and if so, how do i do this?
I am not really sure to understand this question, but I think that you want to order results by their distance from the user's location, right?
If that's the case, you need to order the view by distance from the user. However, this feature is not available yet for the blocks based views. You need to build the view with the legacy editor. You can activate it from Toolset->Settings->General(tab)->Editing experience. If you need help with it. Please open a new ticket and allow me temporary access to your website, so I can show you an example.

- Also i'd like to know if it's possible to show the distance in each search result.
Yes, you can. You will need to use the toolset-maps-distance-value shortcode. If you want the distance from the user's location, this shortcode MUST be wrapped inside the wpv-geolocation shortcode.
Read more about these shortcodes here https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/

- Right now the Custom Search Filter has the text: “Distance show results within” and “of”. (see attached image)
How can i change that text to Dutch? Since my website will be in Dutch..

You can customize the distance search placeholder in the view's settings. For example "Dutch translation within %%DISTANCE%% of %%CENTER%%". Keep in mind that you MUST have the "%%DISTANCE%%" and "%%CENTER%%" on it to let Toolset replace them with the calculated values.
If you are using the legacy editor check this example https://toolset.com/forums/topic/help-with-translation-with-distance-filter/
If you are using the blocks editor check this screenshot hidden link

- How do i change the text: "Enter a location" -> to Dutch? (see attached image)
Well, you can either use a plugin to translate the Toolset Maps strings. A plugin such as ours, WPML String Translation. Or a 3rd party plugin such as Loco Translate. Or you can translate it using a snippet of custom code. Check an example here https://toolset.com/forums/topic/enter-a-location-bug/#post-1628599

- Also there is a button with "My Location"-> "Mijn Locatie". Is it possible to hide that button? (see attached image)
There is no such setting in Toolset. It can only be done using CSS code or Javascript code. If you need help with it, share a URL where I can see on your website and I'll provide a custom CSS code for it.

- Preferrably i'd like to have the searchbar with all fields on one horizontal line, what is the best way to do this (since the distance search looks like attached image).
This will need custom CSS for it. Check these similar cases:
- https://toolset.com/forums/topic/styling-distance-feature-how-to-display-on-one-line-and-only-show-km/#post-2041405
- https://toolset.com/forums/topic/distance-feature-display-in-one-line-and-only-show-km/#post-2053233
If you need further help with it, please open a new thread and share a URL where we can see the filter. Styles depend heavily on the used theme, so there can't be a universal CSS for it.

I hope this helps. Please open a new ticket if you need further assistance with any of these questions.

#2173823

My issue is resolved now. Thank you!