Browse Source

forgot the leaflet_more_maps_cartodb patche

bach 2 years ago
parent
commit
ee0fd6ede6
1 changed files with 42 additions and 0 deletions
  1. 42 0
      patches/leaflet_more_maps_cartodb.patch

+ 42 - 0
patches/leaflet_more_maps_cartodb.patch

@@ -0,0 +1,42 @@
+diff --git a/leaflet_more_maps.module b/leaflet_more_maps.module
+index 308d1eb..fadf2cd 100644
+--- a/leaflet_more_maps.module
++++ b/leaflet_more_maps.module
+@@ -555,6 +555,37 @@ function _leaflet_more_maps_assemble_default_map_info(array &$map_info, array $d
+       ],
+     ],
+   ];
++
++  // cartodb
++  $attr_cartodb = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>';
++  $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],
++        ]
++      ]
++    ];
++  }
+ }
+ 
+ /**