[OpenLayers-Users] Performance?
Jeff Dege
jdege at korterra.com
Wed Aug 16 14:16:04 CDT 2006
________________________________
From: Erik Uzureau [mailto:euzuro at gmail.com]
Sent: Tuesday, August 15, 2006 8:59 PM
To: Jeff Dege
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] Performance?
Hi Jeff,
Are you running on 1.0 version or on the svn HEAD?
I'm running svn HEAD, as of a week or so ago.
We just put a bunch of new funky gridding stuff into the trunk,
like
reusing divs, adjustable tile-buffer, and spiral gridding.
I just did an svn update, and I can see the changes you're talking
about.
To modify the off-current-view tiles, try fiddling with the
'buffer'
property in Grid.js -- ex:
function init(){
map = new OpenLayers.Map( $('map') );
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{layers: 'basic'},
{ tileSize: new OpenLayers.Size(800,475),
buffer: 1 });
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(lon, lat),
zoom);
map.addControl( new
OpenLayers.Control.LayerSwitcher() );
}
The default is set to 2 but you can take it down to 1 (as above)
and that will probably
speed things up for you, though UI-wise it might be less sweet.
I think it's an inherent trade-off. Faster initial load vs. faster
panning after the initial load. Though if you're loading tiles in a
spiral from the center, and the UI remains responsive while the
non-visible tiles are still loading, you might be achieving the best of
both worlds.
Are you spiraling within each layer? Or for all layers?
That is, is it:
for each layer
for each tile, starting at the center and spiraling out
draw the layer's tile
or is it:
for each tile, starting at the center and spiraling out
for each layer
draw the layer's tile
???
Note that setting the buffer to 0 will not work.
So yeah, the reason you are seeing so many tiles loaded is because it is
loading a buffer
of two tiles around the viewport. Also, the reason you dont see simple
numbers like 9
and 25 is because of the way we have implemented gridding -- with
cacheing in mind, OL
uses a sort of world-grid at each zoom level, which means that
specifying a tile size of the
same size as the viewport won't necessarily (in fact quite unlikely)
mean that it will load one
tile smack-dab in the center of the viewport. Does that make sense?
--Erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-viper.python-hosting.com/pipermail/users/attachments/20060816/656274e1/attachment.html
More information about the Users
mailing list