Merge pull request #3192 from elemoine/mapquest-url
Add "url" option to ol.source.MapQuest
This commit is contained in:
@@ -4301,7 +4301,8 @@ olx.source.KMLOptions.prototype.urls;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{layer: string,
|
* @typedef {{layer: string,
|
||||||
* tileLoadFunction: (ol.TileLoadFunctionType|undefined)}}
|
* tileLoadFunction: (ol.TileLoadFunctionType|undefined),
|
||||||
|
* url: (string|undefined)}}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
olx.source.MapQuestOptions;
|
olx.source.MapQuestOptions;
|
||||||
@@ -4323,6 +4324,14 @@ olx.source.MapQuestOptions.prototype.layer;
|
|||||||
olx.source.MapQuestOptions.prototype.tileLoadFunction;
|
olx.source.MapQuestOptions.prototype.tileLoadFunction;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.
|
||||||
|
* @type {string|undefined}
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
olx.source.MapQuestOptions.prototype.url;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{projection: ol.proj.ProjectionLike,
|
* @typedef {{projection: ol.proj.ProjectionLike,
|
||||||
* tileGrid: (ol.tilegrid.TileGrid|undefined)}}
|
* tileGrid: (ol.tilegrid.TileGrid|undefined)}}
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ ol.source.MapQuest = function(opt_options) {
|
|||||||
var layerConfig = ol.source.MapQuestConfig[options.layer];
|
var layerConfig = ol.source.MapQuestConfig[options.layer];
|
||||||
|
|
||||||
var protocol = ol.IS_HTTPS ? 'https:' : 'http:';
|
var protocol = ol.IS_HTTPS ? 'https:' : 'http:';
|
||||||
var url = protocol + '//otile{1-4}-s.mqcdn.com/tiles/1.0.0/' +
|
var url = goog.isDef(options.url) ? options.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, {
|
||||||
|
|||||||
Reference in New Issue
Block a user