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

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
*/
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