[OpenLayers-Users] controlling number of off-edge tiles that loads

Nick Whitelegg nick at hogweed.org
Sun Jul 29 17:10:30 EDT 2007


On Sunday 29 Jul 2007 20:18, Barry Hunter wrote:
> This is almost certainly a very simple question, and I sure I saw something
> mentioning this somewhere, but darned if can find it now...
>
> Anyway I have created a custom layer, which is based on the WMS layer - it
> all works great and displays fine. However many more tiles than are needed
> are fetched,  this is understandable its 'precaching' tiles so that the
> user can drag in any direction quickly.
>
> For example only 24 tiles are needed to fill the whole screen (including
> part tiles) - however 52 tiles are retrieved, this is a bit overkill, I
> would be happy with the user having to wait a bit rather than download that
> many tiles unneeded. I guess there is simple setting to adjust this?
>
> Many thanks,
>
> Barry
>
> P.S. Cant show the map yet, needs to get approval from above first. But as
> soon as it available will post it :)

Hello Barry,

I think setting the 'buffer' parameter to 1 will do it.

From the Freemap code:

var mapnik = new OpenLayers.Layer.WMS( "Freemap/Mapnik", 
			"http://www.free-map.org.uk/cgi-bin/render",
							{buffer:1} );

Nick



More information about the Users mailing list