If sphericalMercator, use default values from Projection.defaults
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user