Provide the ability to get the layer name from a MapQuest source
This commit is contained in:
@@ -24,10 +24,17 @@ ol.source.MapQuest = function(opt_options) {
|
||||
|
||||
var layerConfig = ol.source.MapQuestConfig[options.layer];
|
||||
|
||||
/**
|
||||
* Layer. Possible values are `osm`, `sat`, and `hyb`.
|
||||
* @type {string}
|
||||
* @private
|
||||
*/
|
||||
this.layer_ = options.layer;
|
||||
|
||||
var protocol = ol.IS_HTTPS ? 'https:' : 'http:';
|
||||
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';
|
||||
this.layer_ + '/{z}/{x}/{y}.jpg';
|
||||
|
||||
goog.base(this, {
|
||||
attributions: layerConfig.attributions,
|
||||
@@ -81,3 +88,12 @@ ol.source.MapQuestConfig = {
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {string} Layer.
|
||||
* @api
|
||||
*/
|
||||
ol.source.MapQuest.prototype.getLayer = function() {
|
||||
return this.layer_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user