Use HTTPS where available
This commit is contained in:
@@ -4,7 +4,6 @@ goog.require('goog.Uri');
|
|||||||
goog.require('goog.array');
|
goog.require('goog.array');
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.net.Jsonp');
|
goog.require('goog.net.Jsonp');
|
||||||
goog.require('ol');
|
|
||||||
goog.require('ol.Attribution');
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.TileRange');
|
goog.require('ol.TileRange');
|
||||||
goog.require('ol.TileUrlFunction');
|
goog.require('ol.TileUrlFunction');
|
||||||
@@ -49,15 +48,14 @@ ol.source.BingMaps = function(options) {
|
|||||||
*/
|
*/
|
||||||
this.maxZoom_ = goog.isDef(options.maxZoom) ? options.maxZoom : -1;
|
this.maxZoom_ = goog.isDef(options.maxZoom) ? options.maxZoom : -1;
|
||||||
|
|
||||||
var protocol = ol.IS_HTTPS ? 'https:' : 'http:';
|
|
||||||
var uri = new goog.Uri(
|
var uri = new goog.Uri(
|
||||||
protocol + '//dev.virtualearth.net/REST/v1/Imagery/Metadata/' +
|
'https://dev.virtualearth.net/REST/v1/Imagery/Metadata/' +
|
||||||
options.imagerySet);
|
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',
|
||||||
'uriScheme': ol.IS_HTTPS ? 'https' : 'http',
|
'uriScheme': 'https',
|
||||||
'key': options.key
|
'key': options.key
|
||||||
}, goog.bind(this.handleImageryMetadataResponse, this));
|
}, goog.bind(this.handleImageryMetadataResponse, this));
|
||||||
|
|
||||||
@@ -93,7 +91,7 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse =
|
|||||||
}
|
}
|
||||||
|
|
||||||
var brandLogoUri = response.brandLogoUri;
|
var brandLogoUri = response.brandLogoUri;
|
||||||
if (ol.IS_HTTPS && brandLogoUri.indexOf('https') == -1) {
|
if (brandLogoUri.indexOf('https') == -1) {
|
||||||
brandLogoUri = brandLogoUri.replace('http', 'https');
|
brandLogoUri = brandLogoUri.replace('http', 'https');
|
||||||
}
|
}
|
||||||
//var copyright = response.copyright; // FIXME do we need to display this?
|
//var copyright = response.copyright; // FIXME do we need to display this?
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.source.MapQuest');
|
goog.provide('ol.source.MapQuest');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('ol');
|
|
||||||
goog.require('ol.Attribution');
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
goog.require('ol.source.XYZ');
|
goog.require('ol.source.XYZ');
|
||||||
@@ -32,9 +31,8 @@ ol.source.MapQuest = function(opt_options) {
|
|||||||
*/
|
*/
|
||||||
this.layer_ = options.layer;
|
this.layer_ = 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 :
|
||||||
protocol + '//otile{1-4}-s.mqcdn.com/tiles/1.0.0/' +
|
'https://otile{1-4}-s.mqcdn.com/tiles/1.0.0/' +
|
||||||
this.layer_ + '/{z}/{x}/{y}.jpg';
|
this.layer_ + '/{z}/{x}/{y}.jpg';
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
goog.provide('ol.source.OSM');
|
goog.provide('ol.source.OSM');
|
||||||
|
|
||||||
goog.require('ol');
|
|
||||||
goog.require('ol.Attribution');
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.source.XYZ');
|
goog.require('ol.source.XYZ');
|
||||||
|
|
||||||
@@ -29,9 +28,8 @@ 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 : protocol + '//{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
options.url : 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
attributions: attributions,
|
attributions: attributions,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
goog.provide('ol.source.Stamen');
|
goog.provide('ol.source.Stamen');
|
||||||
|
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('ol');
|
|
||||||
goog.require('ol.Attribution');
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
goog.require('ol.source.XYZ');
|
goog.require('ol.source.XYZ');
|
||||||
@@ -99,11 +98,9 @@ ol.source.Stamen = function(options) {
|
|||||||
'known layer configured');
|
'known layer configured');
|
||||||
var layerConfig = ol.source.StamenLayerConfig[options.layer];
|
var layerConfig = ol.source.StamenLayerConfig[options.layer];
|
||||||
|
|
||||||
var root = ol.IS_HTTPS ? 'https://stamen-tiles-{a-d}.a.ssl.fastly.net/' :
|
|
||||||
'http://{a-d}.tile.stamen.com/';
|
|
||||||
var url = goog.isDef(options.url) ? options.url :
|
var url = goog.isDef(options.url) ? options.url :
|
||||||
root + options.layer + '/{z}/{x}/{y}.' +
|
'https://stamen-tiles-{a-d}.a.ssl.fastly.net/' + options.layer +
|
||||||
layerConfig.extension;
|
'/{z}/{x}/{y}.' + layerConfig.extension;
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
attributions: ol.source.Stamen.ATTRIBUTIONS,
|
attributions: ol.source.Stamen.ATTRIBUTIONS,
|
||||||
|
|||||||
Reference in New Issue
Block a user