From 154e188e89b0348c25e066887859d401a960bcef Mon Sep 17 00:00:00 2001 From: Kathryn Killebrew Date: Fri, 19 Aug 2016 15:47:22 -0400 Subject: [PATCH] Explicitly load admin map tiles via SSL OpenLayers defaults to the site scheme, but we redirect to HTTPS, so explicitly load admin map tiles via HTTPS. Fixes admin interface map tiles not loading due to CSP. --- .../templates/admin/cac-geocoding-map.html | 2 +- .../templates/admin/cac-geocoding-map.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/python/cac_tripplanner/templates/admin/cac-geocoding-map.html b/python/cac_tripplanner/templates/admin/cac-geocoding-map.html index 07516891f..41c42a733 100644 --- a/python/cac_tripplanner/templates/admin/cac-geocoding-map.html +++ b/python/cac_tripplanner/templates/admin/cac-geocoding-map.html @@ -1,4 +1,4 @@ -{% extends 'gis/admin/osm.html' %} +{% extends "gis/admin/openlayers.html" %} {% block openlayers %} {% include 'admin/cac-geocoding-map.js' %} diff --git a/python/cac_tripplanner/templates/admin/cac-geocoding-map.js b/python/cac_tripplanner/templates/admin/cac-geocoding-map.js index 0123f8916..314531535 100644 --- a/python/cac_tripplanner/templates/admin/cac-geocoding-map.js +++ b/python/cac_tripplanner/templates/admin/cac-geocoding-map.js @@ -1,4 +1,12 @@ -{% extends 'gis/admin/osm.js' %} +{% extends "gis/admin/openlayers.js" %} +{% block base_layer %} +// explicitly load via SSL to deal with redirect to HTTPS +new OpenLayers.Layer.OSM("OpenStreetMap", [ + 'https://a.tile.openstreetmap.org/${z}/${x}/${y}.png', + 'https://b.tile.openstreetmap.org/${z}/${x}/${y}.png', + 'https://c.tile.openstreetmap.org/${z}/${x}/${y}.png' +]); +{% endblock %} {% block extra_layers %}