- Issue created by @abelpzl
- Status changed to Closed: works as designed
9 months ago 7:37pm 15 March 2024 - 🇦🇷Argentina abelpzl
My problem was fixed by adding zoomControlPosition => topleft in the definition of my HOOK_leaflet_map_info().
function my_module_leaflet_map_info() { return [ 'my_map' => [ 'label' => 'My Argentine map', 'description' => t('...'), 'settings' => [ // ... 'zoomControlPosition' => 'topleft', // ... ], ], 'layers' => [ ... ], 'plugins' => [ ... ], ], ]; }
The following code works correctly in my case and marks three points on my map
$map_features = [ 0 => [ 'type' => 'point', 'lon' => '-60.292969', 'lat' => '-36.315125' ], 1 => [ 'type' => 'point', 'lon' => '-63.632813', 'lat' => '-32.287133' ], 2 => [ 'type' => 'point', 'lon' => '-65.566406', 'lat' => '-37.195331' ], ]; $map_info = \Drupal::service('leaflet.service')->leafletMapGetInfo()['my_map']; $build['map'] = \Drupal::service('leaflet.service')->leafletRenderMap($map_info, $map_features, '450px');