Skip to content

Commit

Permalink
Explicitly load admin map tiles via SSL
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
flibbertigibbet committed Aug 19, 2016
1 parent eb12463 commit 154e188
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'gis/admin/osm.html' %}
{% extends "gis/admin/openlayers.html" %}

{% block openlayers %}
{% include 'admin/cac-geocoding-map.js' %}
Expand Down
10 changes: 9 additions & 1 deletion python/cac_tripplanner/templates/admin/cac-geocoding-map.js
Original file line number Diff line number Diff line change
@@ -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 %}

Expand Down

0 comments on commit 154e188

Please sign in to comment.