Skip to content

Commit

Permalink
Serve the map and evaluation tool via HTTPS only
Browse files Browse the repository at this point in the history
Drop legacy HTTP 😉

Related to: opening-hours/opening_hours.js#169
Related to: opening-hours/opening_hours.js#172
  • Loading branch information
ypid committed Sep 12, 2016
1 parent c1ba598 commit 1d82098
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ deploy-on-openingh.openstreetmap.de: opening_hours+deps.min.js

.PHONY: deploy-on-openingh.openstreetmap.de
deploy-on-ypid.de: opening_hours+deps.min.js
rsync --archive * [email protected]:/srv/www/osm/userdir/public -v
rsync --archive * [email protected]:/srv/www/osm/sites/openingh.ypid.de/public -v
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<script type="text/javascript">
document.write('</p><p>');
document.write(i18n.t('texts.data source', {
APIaTag: '<a href="http://overpass-api.de/">Overpass API</a>',
APIaTag: '<a href="https://overpass-api.de/">Overpass API</a>',
OSMaTag: '<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap contributors</a>',
OSMStartaTag: '<a href="https://www.openstreetmap.org/">OpenStreetMap</a>',
}) + '<br />');
Expand Down
30 changes: 15 additions & 15 deletions js/OpenStreetMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ OpenLayers.Util.OSM = {};
* Constant: MISSING_TILE_URL
* {String} URL of image to display for missing tiles
*/
OpenLayers.Util.OSM.MISSING_TILE_URL = "http://openstreetmap.org/openlayers/img/404.png";
OpenLayers.Util.OSM.MISSING_TILE_URL = "https://openstreetmap.org/openlayers/img/404.png";

/**
* Property: originalOnImageLoadError
Expand All @@ -19,9 +19,9 @@ OpenLayers.Util.OSM.originalOnImageLoadError = OpenLayers.Util.onImageLoadError;
* Function: onImageLoadError
*/
OpenLayers.Util.onImageLoadError = function() {
if (this.src.match(/^http:\/\/[abc]\.[a-z]+\.openstreetmap\.org\//)) {
if (this.src.match(/^https:\/\/[abc]\.[a-z]+\.openstreetmap\.org\//)) {
this.src = OpenLayers.Util.OSM.MISSING_TILE_URL;
} else if (this.src.match(/^http:\/\/[def]\.tah\.openstreetmap\.org\//)) {
} else if (this.src.match(/^https:\/\/[def]\.tah\.openstreetmap\.org\//)) {
// do nothing - this layer is transparent
} else {
OpenLayers.Util.OSM.originalOnImageLoadError;
Expand All @@ -44,9 +44,9 @@ OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, {
*/
initialize: function(name, options) {
var url = [
"http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
"http://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
"http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
"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"
];
options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options);
var newArguments = [name, url, options];
Expand All @@ -72,9 +72,9 @@ OpenLayers.Layer.OSM.Osmarender = OpenLayers.Class(OpenLayers.Layer.OSM, {
*/
initialize: function(name, options) {
var url = [
"http://a.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
"http://b.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
"http://c.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png"
"https://a.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
"https://b.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
"https://c.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png"
];
options = OpenLayers.Util.extend({ numZoomLevels: 18 }, options);
var newArguments = [name, url, options];
Expand All @@ -100,9 +100,9 @@ OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
*/
initialize: function(name, options) {
var url = [
"http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
"http://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
"http://c.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png"
"https://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
"https://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
"https://c.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png"
];
options = OpenLayers.Util.extend({ numZoomLevels: 19 }, options);
var newArguments = [name, url, options];
Expand All @@ -128,9 +128,9 @@ OpenLayers.Layer.OSM.Maplint = OpenLayers.Class(OpenLayers.Layer.OSM, {
*/
initialize: function(name, options) {
var url = [
"http://d.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
"http://e.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
"http://f.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png"
"https://d.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
"https://e.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png",
"https://f.tah.openstreetmap.org/Tiles/maplint/${z}/${x}/${y}.png"
];
options = OpenLayers.Util.extend({ numZoomLevels: 18, isBaseLayer: false, visibility: false }, options);
var newArguments = [name, url, options];
Expand Down
4 changes: 2 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function editPopupContent(content, lat, lon, type, id, oh_value) {
content += '<a href="https://www.openstreetmap.org/edit?editor=id&'+short_type+'='+id+'" target="_blank">iD</a>&nbsp;&nbsp;';
content +=
'<a href="https://www.openstreetmap.org/edit?'+short_type+'='+id+'&editor=potlatch2" target="_blank">Potlatch</a>'+
'&nbsp;&nbsp;<a href="javascript:josm(\'import?url=' + encodeURIComponent('http://overpass-api.de/api/xapi_meta?*[opening_hours=' + oh_value + ']') + '\')">' + i18n.t('texts.load all with JOSM') + '</a>'+
'&nbsp;&nbsp;<a href="javascript:josm(\'import?url=' + encodeURIComponent('https://overpass-api.de/api/xapi_meta?*[opening_hours=' + oh_value + ']') + '\')">' + i18n.t('texts.load all with JOSM') + '</a>'+
'&nbsp;&nbsp;<a href="javascript:josm(\'load_object?objects=' + short_type + id + '&select=' + short_type + id + '\')">JOSM</a>'+
'&nbsp;&nbsp;<a href="https://www.openstreetmap.org/'+type+'/'+id+'" target="_blank">Details</a>'
+ '&nbsp;&nbsp;<a href="' + evaluation_tool_url + '?EXP='
Expand Down Expand Up @@ -312,7 +312,7 @@ document.onLoadFunctions.push ( function () {
}

var xml = this.overpassQL(this.keyValues);
var url = 'http://overpass-api.de/api/interpreter?&data=' + encodeURIComponent(xml);
var url = 'https://overpass-api.de/api/interpreter?&data=' + encodeURIComponent(xml);

var self = this;
var xhr = new XMLHttpRequest();
Expand Down

0 comments on commit 1d82098

Please sign in to comment.