Skip to content

Commit c9e76ef

Browse files
committed
Fix for osm and mapquest tiles urls (different for the HTTPS)
1 parent 5ae276d commit c9e76ef

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/maps.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,24 @@ weapi.maps.initMap = function(app, type, opt_opts) {
6060
}
6161
}
6262

63-
var protocol = ('https:' == document.location.protocol ? 'https:' : 'http:');
63+
var secure = 'https:' == document.location.protocol;
64+
var protocol = (secure ? 'https:' : 'http:');
6465

6566
var tileProvider;
6667

6768
switch (type) {
6869
case weapi.maps.MapType.MAPQUEST:
6970
if (!mapopts) {
7071
mapopts = {};
71-
mapopts['url'] = protocol + '//otile1.mqcdn.com/tiles/1.0.0/osm/';
72+
mapopts['url'] = protocol + '//otile1' + (secure ? '-s' : '') +
73+
'.mqcdn.com/tiles/1.0.0/osm/';
7274
}
7375
tileProvider = new Cesium.OpenStreetMapImageryProvider(mapopts);
7476
break;
7577
case weapi.maps.MapType.OSM:
7678
if (!mapopts) {
7779
mapopts = {};
78-
mapopts['url'] = protocol + '//tile.openstreetmap.org';
80+
mapopts['url'] = protocol + '//a.tile.openstreetmap.org';
7981
}
8082
tileProvider = new Cesium.OpenStreetMapImageryProvider(mapopts);
8183
break;

0 commit comments

Comments
 (0)