numero2 / contao-storelocator

Contao Plugin for managing stores (or in common address data) and providing a frontend-search based on geo data.
https://www.numero2.de/contao/erweiterungen/storelocator.html
GNU Lesser General Public License v3.0
13 stars 8 forks source link

Doesn't work without Google API key #53

Closed Olli closed 9 months ago

Olli commented 10 months ago

I've changed the frontend to output a openstreetmap based map with leaflet but in the backend the static map doesn't work without the Google API key. This key you only get nowadays if you give them payment information but I'm not willing to do that so the static map doesn't work. Maybe it's good to disable the map view if no API keys provided.

michb commented 10 months ago

We've added the handling for differnt map providers, namely google maps, bing map, and here. If one of them is given and configured with the needed keys, we will add a static map of the geocoordinates otherwise we will show an empty gray box.

Olli commented 10 months ago

While understanding that it's always a hassle to subscribe to such a service, give private data and so on. It's maybe better to add a general option for open services per default. All those other services are in some way or another a hassle to deal with.

michb commented 10 months ago

I have not found a similar feature in openstreetmap (nominatim) that we can use in this place. And I don't like the idea of adding an embeded or javascript map in this place. If there is such a feature, I would happily add it.

Olli commented 10 months ago

You mean something like a static map which adds a locator icon on a certain location? Hm whats wrong with adding leaflet? You have full control over it if you deliver not by a CDN.

At the end the Google static map and the Bing static map doesn't work if you do not register for the API keys or you are not willing to give payment data ... in any cases the map is useless. (I doubt Bing is different ... even though not yet than in maybe in the future).

Olli commented 10 months ago

so maybe the better solution is not to provide any map and also provide a notice for a disabled geocoding if no API key isn't provided. So the user is more in the scene what's wrong.

michb commented 9 months ago

We added a selection in the global settings to choose the provider for the backend. This also includes an option to hide the map completely. We also added a message if the map url cannot be created. Changed in 1e6802d200f668963ecc9e88c9ad75d0337246ef.

If you want to add a different map type, we could add an Hook for customizations. Please open a separate issue for this.

Olli commented 9 months ago

do you bump to a new version?

michb commented 9 months ago

We are working on an other feature this week. After that we will make a new release.

Olli commented 9 months ago

OK thx

Olli commented 9 months ago

Works like a charm. Thanx :-)