[PATCH 4 of 4 [leaflet]] use https to fetch tiles

adrien.dimascio at logilab.fr adrien.dimascio at logilab.fr
Sat Jun 9 18:09:34 CEST 2018


# HG changeset patch
# User Adrien Di Mascio <Adrien.DiMascio at logilab.fr>
# Date 1528560535 -7200
#      sam. juin 09 18:08:55 2018 +0200
# Node ID 7aa83fa0581f0a6da57dd14248574985bb6ba73b
# Parent  958d5d617549772329132bdc4091e264f714a766
use https to fetch tiles

Those tile providers support https and it is required to avoid mixed-content
errors when pages are served in https.

diff --git a/cubicweb_leaflet/views.py b/cubicweb_leaflet/views.py
--- a/cubicweb_leaflet/views.py
+++ b/cubicweb_leaflet/views.py
@@ -52,11 +52,11 @@ class LeafletMap(object):
         'map_options': {},  # see http://leafletjs.com/reference.html#map-options
         }
 
     providers = {
         'osm': {
-            'url': 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
+            'url': 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
             'attribution': (
                 '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, '
                 '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
             ),
         },
@@ -68,19 +68,19 @@ class LeafletMap(object):
                 '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
             ),
         },
         'esri-topomap': {
             'url':
-            'http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/'
+            'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/'
             'tile/{z}/{y}/{x}',
             'attribution': ('{attribution.Esri} — Esri, DeLorme, NAVTEQ, TomTom, Intermap, '
                             'iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, '
                             'Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community')
         },
         'esri-imagery': {
             'url':
-            'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/'
+            'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/'
             'tile/{z}/{y}/{x}',
             'attribution': ('{attribution.Esri} — Source: Esri, i-cubed, USDA, USGS, AEX, '
                             'GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, '
                             'and the GIS User Community')
         }


More information about the cubicweb-devel mailing list