[OpenLayers-Users] 2.3RC1 - Layer (derived from grid) - Resolution array being reset to default

gopal krishnan gopakrishnan at gmail.com
Fri Jan 19 13:18:51 EST 2007


Hi,

I have a layer taht implements Grid class. With 2.1 it used to work fine.
With 2.3 RC1, it no longer uses the resolution array set inside the layer.
And resolution array gets reset. I understand that some new methods have
been added and initresolutions() method moved.

Has the way to set resolution array changed? if so what is the new way to do
so?


I've copied some bits from the class..


OpenLayers.Layer.MyLayer = OpenLayers.Class.create();

OpenLayers.Layer.MyLayer.prototype =

OpenLayers.Class.inherit( OpenLayers.Layer.Grid, {

DEFAULT_PARAMS: {

},

/**

*

* @type Boolean

*/

 isBaseLayer: true,

units: "metres",

resolutions: null,

projection: "EPSG:27700",

tileSize: null,

url: null,

type:null,

buffer:1,

initialize: function(name,url, params, options,type) {

this.type = type;

if (this.type == "IMAGE")

{

this.tileSize = new OpenLayers.Size(250, 250);

this.layer.resolutions = [4096,2048,1024,512,256,128,64,32,16,8,4,2,1,0.5,
0.25];

}

else

{

this.tileSize = new OpenLayers.Size(250, 250);

this.type = "MAP" ;

this.resolutions = [4096,2048,1024,512,256,128,64,32,16,8,4,2,1,0.5,0.25];

}

url = url;

var newArguments = new Array();

newArguments.push(name, url, params, options);

OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments);

this.params = (params ? params : {});

if (params) {

OpenLayers.Util.applyDefaults(

this.params,

this.DEFAULT_PARAMS

);

}

},



thanks

G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070119/3bbfa4b3/attachment.html


More information about the Users mailing list