[OpenLayers-Users] Move listener curious behaviour

Tobias Reinicke ramotswa at gmail.com
Tue Jan 31 09:05:24 EST 2012


Hello all,

I have spotted some curious behaviour with the move listener on the
map object. (using OL 2.11).

The code is pretty simple..

map = new OpenLayers.Map({
    controls: [new OpenLayers.Control.Navigation() ],
    div: "map",
    eventListeners: {
        "move": updateCoord
    }

});

and the updatecoord function is just this:
   function updateMap() {
                 var tlPixel = new OpenLayers.Pixel(10,10);
                var tl = map.getLonLatFromLayerPx(tlPixel);
                document.getElementById('output').innerHTML = tl.toString();
}


The problem I'm seeing is that the coordinates are only updated every
time I zoom, rather than everytime I pan / drag etc...

Any ideas?

Thanks,

Toby


More information about the Users mailing list