Preserve numZoomLevels from options. r=@tonio (see #219)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user