- Issue created by @abelpzl
- Status changed to Closed: works as designed
8 months ago 8:22pm 22 April 2024 - 🇦🇷Argentina abelpzl
Investigating the problem I realized that the following error was being displayed in the DevTools console
drupal.js?v=10.2.4:64 Uncaught TypeError: Cannot read properties of undefined (reading 'include_path')
On line 525 of the file leaflet/js/leaflet.drupal.js :
lFeature = this.create_polygon(feature, map_settings ? map_settings['leaflet_markercluster']['include_path'] : false);
An error occurs if $map_settings['leaflet_markercluster'] does not have a value.
-
Fix the problem by adding'leaflet_markercluster' => ['include_path' => FALSE, 'control' => FALSE],
in 'mymap' configuration.function my_modulo_leaflet_map_info() { return [ 'MyMap' => [ 'label' => 'My Map', 'description' => t('My map'), 'settings' => [ 'center' => [ 'lat' => '-40.41', 'lon' => '-64.69', ], 'dragging' => TRUE, 'touchZoom' => TRUE, 'scrollWheelZoom' => TRUE, 'doubleClickZoom' => TRUE, 'zoomControl' => TRUE, 'attributionControl' => TRUE, 'trackResize' => TRUE, 'fadeAnimation' => TRUE, 'zoomAnimation' => TRUE, 'closePopupOnClick' => TRUE, 'layerControl' => TRUE, 'layerControlOptions' => [ 'position' => 'topright', ], 'leaflet_markercluster' => ['include_path' => FALSE, 'control' => FALSE], ], 'layers' => [ 'earth' => [ // ... ], ], ], 'plugins' => [], ], ]; }
-
I think this should not be a required parameter.