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
|
* options - {Object} Hashtable of extra options to tag onto the layer
|
||||||
*/
|
*/
|
||||||
initialize: function(name, url, options) {
|
initialize: function(name, url, options) {
|
||||||
if (options && options.sphericalMercator || this.sphericalMercator) {
|
options = options || {};
|
||||||
options = OpenLayers.Util.extend({
|
if (options.sphericalMercator || this.sphericalMercator) {
|
||||||
maxExtent: new OpenLayers.Bounds(
|
options.projection = new OpenLayers.Projection('EPSG:900913');
|
||||||
-128 * 156543.03390625,
|
options.numZoomLevels = 19;
|
||||||
-128 * 156543.03390625,
|
|
||||||
128 * 156543.03390625,
|
|
||||||
128 * 156543.03390625
|
|
||||||
),
|
|
||||||
maxResolution: 156543.03390625,
|
|
||||||
numZoomLevels: 19,
|
|
||||||
units: "m",
|
|
||||||
projection: "EPSG:900913"
|
|
||||||
}, options);
|
|
||||||
}
|
}
|
||||||
url = url || this.url;
|
url = url || this.url;
|
||||||
name = name || this.name;
|
name = name || this.name;
|
||||||
|
|||||||
Reference in New Issue
Block a user