Merge pull request #1897 from tschaub/absolute
Don't use protocol relative URLs.
This commit is contained in:
@@ -54,6 +54,14 @@ ol.ENABLE_WEBGL = true;
|
|||||||
ol.LEGACY_IE_SUPPORT = false;
|
ol.LEGACY_IE_SUPPORT = false;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The page is loaded using HTTPS.
|
||||||
|
* @const
|
||||||
|
* @type {boolean}
|
||||||
|
*/
|
||||||
|
ol.IS_HTTPS = goog.global.location.protocol === 'https:';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the current browser is legacy IE
|
* Whether the current browser is legacy IE
|
||||||
* @const
|
* @const
|
||||||
|
|||||||
@@ -37,8 +37,11 @@ ol.source.BingMaps = function(options) {
|
|||||||
*/
|
*/
|
||||||
this.culture_ = goog.isDef(options.culture) ? options.culture : 'en-us';
|
this.culture_ = goog.isDef(options.culture) ? options.culture : 'en-us';
|
||||||
|
|
||||||
|
var protocol = ol.IS_HTTPS ? 'https:' : 'http:';
|
||||||
var uri = new goog.Uri(
|
var uri = new goog.Uri(
|
||||||
'//dev.virtualearth.net/REST/v1/Imagery/Metadata/' + options.imagerySet);
|
protocol + '//dev.virtualearth.net/REST/v1/Imagery/Metadata/' +
|
||||||
|
options.imagerySet);
|
||||||
|
|
||||||
var jsonp = new goog.net.Jsonp(uri, 'jsonp');
|
var jsonp = new goog.net.Jsonp(uri, 'jsonp');
|
||||||
jsonp.send({
|
jsonp.send({
|
||||||
'include': 'ImageryProviders',
|
'include': 'ImageryProviders',
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ ol.source.MapQuest = function(opt_options) {
|
|||||||
|
|
||||||
var layerConfig = ol.source.MapQuestConfig[options.layer];
|
var layerConfig = ol.source.MapQuestConfig[options.layer];
|
||||||
|
|
||||||
var url = '//otile{1-4}-s.mqcdn.com/tiles/1.0.0/' +
|
var protocol = ol.IS_HTTPS ? 'https:' : 'http:';
|
||||||
|
var url = protocol + '//otile{1-4}-s.mqcdn.com/tiles/1.0.0/' +
|
||||||
options.layer + '/{z}/{x}/{y}.jpg';
|
options.layer + '/{z}/{x}/{y}.jpg';
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
|
|||||||
@@ -25,8 +25,9 @@ ol.source.OSM = function(opt_options) {
|
|||||||
var crossOrigin = goog.isDef(options.crossOrigin) ?
|
var crossOrigin = goog.isDef(options.crossOrigin) ?
|
||||||
options.crossOrigin : 'anonymous';
|
options.crossOrigin : 'anonymous';
|
||||||
|
|
||||||
|
var protocol = ol.IS_HTTPS ? 'https:' : 'http:';
|
||||||
var url = goog.isDef(options.url) ?
|
var url = goog.isDef(options.url) ?
|
||||||
options.url : '//{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
options.url : protocol + '//{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
attributions: attributions,
|
attributions: attributions,
|
||||||
|
|||||||
@@ -93,8 +93,9 @@ ol.source.Stamen = function(options) {
|
|||||||
goog.asserts.assert(options.layer in ol.source.StamenLayerConfig);
|
goog.asserts.assert(options.layer in ol.source.StamenLayerConfig);
|
||||||
var layerConfig = ol.source.StamenLayerConfig[options.layer];
|
var layerConfig = ol.source.StamenLayerConfig[options.layer];
|
||||||
|
|
||||||
|
var protocol = ol.IS_HTTPS ? 'https:' : 'http:';
|
||||||
var url = goog.isDef(options.url) ? options.url :
|
var url = goog.isDef(options.url) ? options.url :
|
||||||
'//{a-d}.tile.stamen.com/' + options.layer + '/{z}/{x}/{y}.' +
|
protocol + '//{a-d}.tile.stamen.com/' + options.layer + '/{z}/{x}/{y}.' +
|
||||||
layerConfig.extension;
|
layerConfig.extension;
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
|
|||||||
Reference in New Issue
Block a user