[OpenLayers-Users] Layer.redraw() - strange behavior

Richard Wiesinger richard.wiesinger at gmail.com
Wed Nov 18 12:54:35 EST 2009


Hi list,

i extended the OpenLayers.Layer.OSM class to provide my own layer and
overrid the getURL(bounds) function as I load the osm tiles from my own
server.
The strategy is as follows:
When getURL is called on the browser an ajax request is called to my osm
server and the necessary tiles are loaded and stored to the webserver. This
works pretty well and I can see tiles lying around on my webserver. But of
course this takes some time and is too late for openlayers to render this
specific tile in the scope of the getURL method. So there are no tiles
visible in the browser which is logical.
I now tried to call layername.redraw() in firebug after all tiles where
loaded. I see in firebug that all the necessary tiles are again requested
within the getURL function. The URLs are alright and the tiles are at the
right place. But again nothing is visible in the browser!
But now comes the strange thing. When I copy one url string of a tile from
the firebug console and open it in a new browser window, the tile (.png) is
shown in the browser! And even more strange (at least for me) when I *now*
call layername.redraw() this tile is shown in the map. But only this tile
and not the others. When I open another tile in a new tab and call redraw()
again two tiles are visible and so on.
It seems that tiles are visible only when they are requested before.

Somebody has an idea?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091118/d10ca5a6/attachment.html


More information about the Users mailing list