From c3a9da98de44d7002434f7221b52e15edf475399 Mon Sep 17 00:00:00 2001 From: bach Date: Wed, 15 Feb 2023 23:07:24 +0100 Subject: [PATCH] forgot leaflet_more_maps patch file --- patches/leaflet_more_maps_cartodb-2.1.3.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 patches/leaflet_more_maps_cartodb-2.1.3.patch diff --git a/patches/leaflet_more_maps_cartodb-2.1.3.patch b/patches/leaflet_more_maps_cartodb-2.1.3.patch new file mode 100644 index 00000000..8f99fa7f --- /dev/null +++ b/patches/leaflet_more_maps_cartodb-2.1.3.patch @@ -0,0 +1,43 @@ +diff --git a/leaflet_more_maps.module b/leaflet_more_maps.module +index cce4c86..33e9a60 100644 +--- a/leaflet_more_maps.module ++++ b/leaflet_more_maps.module +@@ -556,6 +556,38 @@ function _leaflet_more_maps_assemble_default_map_info(array &$map_info, array $d + ], + ]; + ++ ++ // cartodb ++ $attr_cartodb = '© OpenStreetMap contributors © CARTO'; ++ $cartodb_names = [ ++ 'light_all', ++ 'light_nolabels', ++ 'light_only_labels', ++ 'dark_all', ++ 'dark_nolabels', ++ 'dark_only_labels', ++ 'rastertiles/voyager', ++ 'rastertiles/voyager_nolabels', ++ 'rastertiles/voyager_only_labels', ++ 'rastertiles/voyager_labels_under' ++ ]; ++ foreach ($cartodb_names as $cartodb_name) { ++ $code = mb_strtolower($cartodb_name); ++ $label = t('Cartodb @name', ['@name' => $cartodb_name]); ++ $url_template = "https://{s}.basemaps.cartocdn.com/$code/{z}/{x}/{y}{r}.png"; ++ $map_info["cartodb-$code"] = [ ++ 'label' => $label, ++ 'description' => $label, ++ 'settings' => $default_settings, ++ 'layers' => [ ++ '' => [ ++ 'urlTemplate' => $url_template, ++ 'options' => ['attribution' => $attr_cartodb], ++ ] ++ ] ++ ]; ++ } ++ + // Add hook to change default list of maps. + // Let other modules alter the default map info. + \Drupal::moduleHandler()->invokeAll('leaflet_more_maps_list_alter', array(&$map_info));