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

* templates for loading with leaflat added #51

Closed Olli closed 1 year ago

Olli commented 1 year ago

Hi, nowadays Google maps is utterly complicated to integrate. So I did match the code so it works with the Leaflat lib and Openstreetmap. It'll be nice if you can add the ability to change templates so some can chose from different providers.

michb commented 1 year ago

thank you, we will have to make some more change to the code to make it configurable in the module settings

michb commented 1 year ago

Hi @Olli, while we appreciate the effort there are some problems with your changes.

The template script_storelocator_leaflat.html5 extends the wrong template (should be script_loader_leaflet not script_loader_googlemap). This causes the assets not to be loaded at all. If you were to correct this at least your map would wait till all the necessary scripts are loaded. Assets should always be part of our extension and not be loaded from externally. Displaying the markers does not work quite right, e.g. if there is nothing selected in the backend settings - there should be a proper default. The map should always show were the markers are, currently you added a hardcoded default location with a fixed zoom level.

So unfortunately, we won't be able to merge your PR.

Olli commented 1 year ago

Hi, thanks for your response and feedback. I also have found some problems while working with it on my own place. I will create another Pull for that with the corrected code. Unfortunately I didn't had time yet. I also did remove the Marker Cluster code because it seems a marker cluster for leaflat is quite old ...