Preserve numZoomLevels from options. r=@tonio (see #219)

This commit is contained in:
fredj
2012-02-16 15:09:11 +01:00
parent 0727f5558a
commit 17f96f68a2
+5 -4
View File
@@ -70,10 +70,11 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, {
* options - {Object} Hashtable of extra options to tag onto the layer * options - {Object} Hashtable of extra options to tag onto the layer
*/ */
initialize: function(name, url, options) { initialize: function(name, url, options) {
options = options || {}; if (options && options.sphericalMercator || this.sphericalMercator) {
if (options.sphericalMercator || this.sphericalMercator) { options = OpenLayers.Util.extend({
options.projection = new OpenLayers.Projection('EPSG:900913'); projection: "EPSG:900913",
options.numZoomLevels = 19; numZoomLevels: 19
}, options);
} }
OpenLayers.Layer.Grid.prototype.initialize.apply(this, [ OpenLayers.Layer.Grid.prototype.initialize.apply(this, [
name || this.name, url || this.url, {}, options name || this.name, url || this.url, {}, options