[OpenLayers-Users] Smart Switching of Layers
NORMAN MANN
normanmann at btinternet.com
Wed Apr 28 11:07:22 EDT 2010
HI all,
I am new to GIS and specifically openlayers.
I have a fairly simple WMS app built on openlayers.
However due to performance I would like to make things seem as if they are performing faster. At the moment we have a tiled layer, and a single none tiled layer. The single layer is loaded first, then we catch a "moveend" then switch the base layer to a tiled one.
The initial load is quite quick but then switching to the tiled layer can take some time to satisfy the plethora of requests fired out.
What I would like to do is, show the single layer first, then in the back ground immediately fire off the requests for the tiled layer (without displaying it). When they scroll I would like to switch to the tiled layer, which should have hopefully started loading at this point.
When they change zoom , i would like to switch back to the single layer (as I think this gives the users something to look at the fastest) then again kick of the tiled layer to load in the background.
Is this a feasible and reasonable thing to want to achieve? At the moment I am using a movestart event to change the baselayer hopefully before a zoom. I am comparing the last zoom level with the current one to ascertain whether its been zoomed or not. So,is there anyway to start a tiled layer loading in the background? Is there anyway for a tiled layer to request the visible tiles first? Whats the best way of controlling a switch between a single layer and a tiled layer (we can get quite a large tile for the single layer and dont want to switch immediately)?
Sorry for all the questions, it probably just demonstrated my lack of understanding.
Any advice greatly appreciated.
Thanks
Norman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100428/790ceef2/attachment.html
More information about the Users
mailing list