- Merge request !5Issue #3565358: Treat tilde-prefixed maps as composite collections → (Open) created by NicolasH
When using leaflet_more_maps to define custom composite map collections (those with a tilde ~ prefix, e.g., ~My-Custom-Map), the Map Bundle form in leaflet_layers displays these collections incorrectly:
leaflet_more_maps modulehook_leaflet_map_info_alter():$map_info['~My-Custom-Map'] = [
'label' => 'My Custom Map',
'layers' => [
'OSM' => [...],
'Satellite' => [...],
],
];
Expected: The composite collection should appear as a single selectable option.
Detect tilde-prefixed map keys and treat them as single composite base layer entries:
MapBundleForm::getData(): Check for ~ prefix and create one entry with layer_id: __composite__ instead of iterating through individual layersleaflet_layers_leaflet_map_info(): When encountering __composite__ layer_id, copy all layers from the source map into the bundleThis preserves the layer switcher functionality while presenting the collection as a single manageable option in the admin UI.
The Map Bundle edit form will show composite collections (tilde-prefixed maps) as a single row labeled "(composite)" instead of multiple rows for each individual layer.
<!-- Add before/after screenshots here -->N/A
Map Bundle entities will store composite collections with a special layer_id: __composite__ value instead of individual layer IDs. This is backwards compatible - existing bundles with individual layer entries will continue to work.
Active
1.1
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.