backdrop-contrib / leaflet

Backdrop CMS Integration with the Leaflet map scripting library.
https://backdropcms.org/project/leaflet
GNU General Public License v2.0
2 stars 2 forks source link

Custom maps don't see layers defined via hook_leaflet_map_info() #27

Closed AlexHoebart-ICPDR closed 2 years ago

AlexHoebart-ICPDR commented 2 years ago

Custom maps which can be defined in the Leaflet More Maps settings, do not see additional layers defined via hook_leaflet_map_info() This worked in the Drupal7 version, some original code is missing or is in the wrong hook. Will add a PR.

indigoxela commented 2 years ago

@AlexHoebart-ICPDR many thanks for reporting. Will have a closer look ASAP.

indigoxela commented 2 years ago

I took a look now. Honestly, at first I found the switch from leaflet_more_maps_leaflet_map_info to leaflet_more_maps_leaflet_map_info_alter a bit irritating, but then I realized the problem with overlaps (recursion) that would otherwise pop up.

Tested your changes locally, also with a custom module implementing that hook (but osm mapnik earth also wasn't available before). This all works like a charm, many thanks for contributing!