Skip to content

Commit

Permalink
Fix for osm and mapquest tiles urls (different for the HTTPS)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrsloup committed Dec 4, 2014
1 parent 5ae276d commit c9e76ef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,24 @@ weapi.maps.initMap = function(app, type, opt_opts) {
}
}

var protocol = ('https:' == document.location.protocol ? 'https:' : 'http:');
var secure = 'https:' == document.location.protocol;
var protocol = (secure ? 'https:' : 'http:');

var tileProvider;

switch (type) {
case weapi.maps.MapType.MAPQUEST:
if (!mapopts) {
mapopts = {};
mapopts['url'] = protocol + '//otile1.mqcdn.com/tiles/1.0.0/osm/';
mapopts['url'] = protocol + '//otile1' + (secure ? '-s' : '') +
'.mqcdn.com/tiles/1.0.0/osm/';
}
tileProvider = new Cesium.OpenStreetMapImageryProvider(mapopts);
break;
case weapi.maps.MapType.OSM:
if (!mapopts) {
mapopts = {};
mapopts['url'] = protocol + '//tile.openstreetmap.org';
mapopts['url'] = protocol + '//a.tile.openstreetmap.org';
}
tileProvider = new Cesium.OpenStreetMapImageryProvider(mapopts);
break;
Expand Down

0 comments on commit c9e76ef

Please sign in to comment.