[OpenLayers-Users] Change in API stopping a test app working?

Christopher Schmidt crschmidt at crschmidt.net
Mon Jul 3 16:23:59 CDT 2006


On Mon, Jul 03, 2006 at 10:12:54PM +0100, nick at hogweed.org wrote:
> Hello Erik (or anyone else),
> 
> Remember a couple of weeks ago I talked about implementing my own annotations 
> layer? Got it to work in the end but now it appears to have stopped working 
> so I'm guessing the code has changed. I now get the error:
> 
> Error: this.tileSize has no properties
> Source File: http://openlayers.org/dev/lib/OpenLayers/Layer/Grid.js
> Line: 130

Ah, life on the bleeding edge. ;)

> Has something in the api changed? I didn't get this error before.

I'm not sure exactly what changed that caused this -- it wasn't
happening on your site when I looked at it 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.

-- 
Christopher Schmidt
Web Developer


More information about the Users mailing list