Skip Navigation

[Resolved] Toolset maps plugin

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to limit map suggestions to only those in the Netherlands.

Solution: Use custom JavaScript to limit the map suggestions to one country:

jQuery(".js-toolset-maps-distance-center").geocomplete({country: 'US',type: []});
This support ticket is created 4 years, 9 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by jelle-jacobd 4 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1506887

I have some minor issues/questions with the Toolset maps plugin:

1. The Google maps filter should show only results form the Netherlands, is that possible?
2. The icon on the button "Use my location" shows an square box and no icon when I change the font-face?
3. The unit for distance in Holland is km, so there's no need voor MI to be available in the dropdown. Can I turn this of? Or should I just hide it with CSS?

Thanks, Jelle

#1507793
1379367-Screen_Shot_2019_11_10_at_10.17.40_AM.png

Hi, please find some answers below.

1. The Google maps filter should show only results form the Netherlands, is that possible?
This is possible but it requires some custom JavaScript that interacts with the Google Maps JS API. You can add some code in the View's Loop Editor JS panel to limit the filter results to a specific country. Here's an example:

jQuery(".js-toolset-maps-distance-center").geocomplete({country: 'US',type: []});

Two letter country codes are ISO 3166-1, you can see the list here: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
I think the Netherlands is NL but please check the list to be sure.

2. The icon on the button "Use my location" shows an square box and no icon when I change the font-face?
Yes, the icon is provided by the FontAwesome 4 library. If you want to display the icon, that library should be enqueued. It should look like the screenshot here. In any other font-face, the square character represents a missing glyph. I would not expect the icon to work with any other font-face, so you could change the value of that button with JavaScript to remove the missing character.

3. The unit for distance in Holland is km, so there's no need voor MI to be available in the dropdown. Can I turn this of? Or should I just hide it with CSS?
Toolset Maps does not provide a way to remove the "mi" option, so a CSS solution to hide the input and show a text replacement might be best.

#1508355

Hi Christian,

Thanks for solving the issues mentoined.

1. Solved with the snippet for NL
2. Oke, wil hide it with CSS
3. Same, hidden with CSS

Thank you!