Preserve numZoomLevels from options. r=@tonio (see #219)
This commit is contained in:
@@ -70,10 +70,11 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer
|
||||
*/
|
||||
initialize: function(name, url, options) {
|
||||
options = options || {};
|
||||
if (options.sphericalMercator || this.sphericalMercator) {
|
||||
options.projection = new OpenLayers.Projection('EPSG:900913');
|
||||
options.numZoomLevels = 19;
|
||||
if (options && options.sphericalMercator || this.sphericalMercator) {
|
||||
options = OpenLayers.Util.extend({
|
||||
projection: "EPSG:900913",
|
||||
numZoomLevels: 19
|
||||
}, options);
|
||||
}
|
||||
OpenLayers.Layer.Grid.prototype.initialize.apply(this, [
|
||||
name || this.name, url || this.url, {}, options
|
||||
|
||||
Reference in New Issue
Block a user