- Status changed to Fixed
6 months ago 8:13pm 28 May 2024 Automatically closed - issue fixed for 2 weeks with no activity.
It would be a good idea to add another hook to give custom modules the possibility to add other maps to the default list displayed at /admin/config/system/leaflet_more_maps something like hook_leaflet_more_maps_default_map_list_alter(&$map_info)
Implementation example (Result in attached ScreenShot).
/**
* Implements hook_leaflet_more_maps_default_map_list_alter().
*/
function MY_MODULE_leaflet_more_maps_default_map_list_alter(&$map_info) {
// Use headless protocol rather than logic based on global $is_https.
$prot = '//';
// Assemble xyz used by openSeaMaps.
$zxy = '{z}/{x}/{y}.png';
$map_info['openseamaps'] = [
'label' => 'Open Sea Map',
'description' => 'OpenSeaMaps Layer',
'settings' => [
'attributionControl' => TRUE,
'closePopupOnClick' => TRUE,
'doubleClickZoom' => TRUE,
'dragging' => TRUE,
'fadeAnimation' => TRUE,
'layerControl' => TRUE,
'maxZoom' => 18,
'minZoom' => 1,
'scrollWheelZoom' => TRUE,
'touchZoom' => TRUE,
'trackResize' => TRUE,
'zoomAnimation' => TRUE,
'zoomControl' => TRUE,
],
'layers' => [
'earth' => [
'urlTemplate' => $prot . '{s}.tile.openstreetmap.org/' . $zxy,
'options' => [
'attribution' => "Map data © <a href='http://openstreetmap.org'>OSM Mapnik</a>",
'subdomains' => [
0 => 'a',
1 => 'b',
2 => 'c',
],
],
],
'seamark' => [
'urlTemplate' => $prot . 'tiles.openseamap.org/seamark/' . $zxy,
'isBaseLayer' => FALSE,
'layerControl' => TRUE,
'options' => [
'attribution' => "Map data © <a href='http://openseamap.org'>Open Sea Maps</a>",
'subdomains' => [
0 => 'a',
1 => 'b',
2 => 'c',
],
],
],
],
];
}
Fixed
2.1
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed - issue fixed for 2 weeks with no activity.