[OpenLayers-Users] Overlay dont "refresh" with setcenter forcezoom.

Tom (JDi Solutions) tom.dean at jdi-solutions.co.uk
Sun Aug 26 05:31:51 EDT 2007


Not sure what to actually do about it but could it be that the tiles are
being cached by the browser?  In my experience browser caching can be
unpredictable at best especially when you consider that corporate content
filters / firewalls and proxies also often have caching features.  There are
ways to set the headers on files to tell the browser not to cache it but
they are not reliable.  Maybe OpenLayers / Geoserver has a clever way around
this?  One way you could possibly improve things is to set your overlay to
be non tiled, that way the requests will almost always be different and the
browser won't cache them.

On 8/26/07, Jonke <jonke at bt.nu> wrote:
>
>
> I really like openlayers.
>
> However I have problem with the automatic refresh of a overlay (that is a
> layer that is not a baselayer).
> I have read thorough all the examples and I especially the one with the
> Webcam.
>
> However I start by describing the setup.
>
> I have a baselayer (a big one with many layers in it served by GeoServer)
> changes very rare.
>
> I have a almost realtime dataset with 1 000 000 items, changes very
> frequently (300 000 changes every 30s), this is setup as a transperent
> overlay with the isbaselayer: false. ( We can call this layer for overlay)
>
> Both the baselayer and overlay have the tiled attribute set (not a
> tiledcache as a backend but just a vanilla geoserver).
>
>
> When I scroll and pan and use the zoomin zoomout with the Mouse, the
> overlay
> is properly refreshed and everything is fine.
>
> When I try to do this javascript wise to get a "automatic refresh" (with a
> map.setCenter or layer.moveTo and the forcezoom to true), then I only see
> the old overlay that seems to have been cached somewhere (and it is not by
> the geoserver). I have tried different things, "zoomOut();zoomIn();" and
> "removelayer(overlay);addlayer(overlay)" with no luck.
>
> Could it be that the layers are tiled and as long as I am in the same tile
> a
> new request to the geoserver is not spawned?
>
> I've read the openlayers source but I can't pinpoint where the decision to
> retrieve or not retrieve data from the geoserver is done.
>
> I tried to remove the tiled attribute for the overlay but that seem to do
> not what I intended but to download a very large tile of my overlay and
> still not updateing using center, moveto.
>
> But here comes the 'scratch my head' part, if I with firefox open two tabs
> to the same url where my openlayers are and switch back and fort between
> them, then the center method works with both layers having the tiled
> attribute. If I stay in one tab I don't see any change of my overlay, if I
> go to the next tab the overlay is refreshed and then I go back to the
> first
> tab the overlay is refreshed.
>
> If someone can point me to the "right way" todo this with many geometries
> I
> will gladly test another approach.
>
> Regards.
> --
> View this message in context:
> http://www.nabble.com/Overlay-dont-%22refresh%22-with-setcenter-forcezoom.-tf4327410.html#a12324516
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070826/a6833014/attachment.html


More information about the Users mailing list