From a40ae7ef11a4690085082ec9a2e300b9edd98c8d Mon Sep 17 00:00:00 2001 From: fredj Date: Wed, 15 Feb 2012 12:30:05 +0100 Subject: [PATCH] If sphericalMercator, use default values from Projection.defaults --- lib/OpenLayers/Layer/XYZ.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/OpenLayers/Layer/XYZ.js b/lib/OpenLayers/Layer/XYZ.js index 7977a3255f..4c2bfc051d 100644 --- a/lib/OpenLayers/Layer/XYZ.js +++ b/lib/OpenLayers/Layer/XYZ.js @@ -70,19 +70,10 @@ OpenLayers.Layer.XYZ = OpenLayers.Class(OpenLayers.Layer.Grid, { * options - {Object} Hashtable of extra options to tag onto the layer */ initialize: function(name, url, options) { - if (options && options.sphericalMercator || this.sphericalMercator) { - options = OpenLayers.Util.extend({ - maxExtent: new OpenLayers.Bounds( - -128 * 156543.03390625, - -128 * 156543.03390625, - 128 * 156543.03390625, - 128 * 156543.03390625 - ), - maxResolution: 156543.03390625, - numZoomLevels: 19, - units: "m", - projection: "EPSG:900913" - }, options); + options = options || {}; + if (options.sphericalMercator || this.sphericalMercator) { + options.projection = new OpenLayers.Projection('EPSG:900913'); + options.numZoomLevels = 19; } url = url || this.url; name = name || this.name;