[OpenLayers-Users] Change in API stopping a test app working?
nick@hogweed.org
nick at hogweed.org
Mon Jul 3 17:51:45 CDT 2006
> I'm not sure exactly what changed that caused this -- it wasn't
> happening on your site when I looked at it this morning.
The code was commented out this morning.
> But you probably want something in osmlayer.js which subclasses the
> setMap call: you can just call out to the Grid.js version, probably:
>
> setMap: function(map) {
> OpenLayers.Layer.prototype.setMap.apply(this, arguments);
> if (this.tileSize == null) {
> this.tileSize = this.map.getTileSize();
> }
> },
>
> This is a relatively recent change in the API.
My layer subclasses Layer.Grid so it should override this anyway. Tried adding
it anyhow, but didn't solve the problem. Specifically the error is in the
_initTiles() method
var tilelon = resolution*this.tileSize.w;
generates the error. So I guess for one reason or another it hasn't
initialised tileSize.
Maybe worth just trying the 1.0 api - is this change more recent?
Nick
More information about the Users
mailing list