add layers and resolutions array
This commit is contained in:
@@ -125,3 +125,27 @@ ol.Map.prototype.numZoomLevels = function(opt_arg) {
|
||||
return this.getNumZoomLevels();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Array=} opt_arg
|
||||
* @returns {ol.Map|Array|undefined} Map center.
|
||||
*/
|
||||
ol.Map.prototype.resolutions = function(opt_arg) {
|
||||
if (arguments.length == 1 && goog.isDef(opt_arg)) {
|
||||
return this.setResolutions(opt_arg);
|
||||
} else {
|
||||
return this.getResolutions();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Array=} opt_arg
|
||||
* @returns {ol.Map|Array|undefined} Map center.
|
||||
*/
|
||||
ol.Map.prototype.layers = function(opt_arg) {
|
||||
if (arguments.length == 1 && goog.isDef(opt_arg)) {
|
||||
return this.setLayers(opt_arg);
|
||||
} else {
|
||||
return this.getLayers();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -40,6 +40,18 @@ ol.Map = function() {
|
||||
*/
|
||||
this.numZoomLevels_ = 22;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array|undefined}
|
||||
*/
|
||||
this.resolutions_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array|undefined}
|
||||
*/
|
||||
this.layers_ = null;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -100,6 +112,22 @@ ol.Map.prototype.getNumZoomLevels = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array|undefined} array of resolutions available for this map
|
||||
*/
|
||||
ol.Map.prototype.getResolutions = function() {
|
||||
return this.resolutions_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array|undefined} array of layers available for this map
|
||||
*/
|
||||
ol.Map.prototype.getLayers = function() {
|
||||
return this.layers_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Loc} center Center.
|
||||
* @return {ol.Map} This.
|
||||
@@ -149,11 +177,29 @@ ol.Map.prototype.setNumZoomLevels = function(nZoom) {
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Array} resolutions the map resolutions if set on the map
|
||||
* @return {ol.Map} This.
|
||||
*/
|
||||
ol.Map.prototype.setResolutions = function(resolutions) {
|
||||
this.resolutions_ = resolutions;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Array} layers the layers set on the map
|
||||
* @return {ol.Map} This.
|
||||
*/
|
||||
ol.Map.prototype.setLayers = function(layers) {
|
||||
this.layers_ = layers;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
ol.Map.prototype.destroy = function() {
|
||||
//remove layers, etc.
|
||||
for (key in this) {
|
||||
for (var key in this) {
|
||||
delete this[key];
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user