Default the buffer to 0 instead of 2. On small maps (or fullscreen

maps on small devices) this is a huge win: instead of downloading
*42 tiles* on a 500x500 div, we now download just 12, a 3.5x savings
in downloads by default. The buffer of 2 was originally chosen when
most maps were based on slow-loading WMS laeyrs and having an area
to pan into was more important. That default no longer makes sense.

(Closes #3111) r=tschaub


git-svn-id: http://svn.openlayers.org/trunk/openlayers@11481 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2011-02-25 11:50:30 +00:00
parent f7fcb86ee9
commit 339d1ebaef
10 changed files with 24 additions and 21 deletions
+2 -2
View File
@@ -27,7 +27,7 @@
layer = new OpenLayers.Layer.Grid(name, url, params, null);
t.ok( layer instanceof OpenLayers.Layer.Grid, "returns OpenLayers.Layer.Grid object" );
t.eq( layer.buffer, 2, "buffer default is 2");
t.eq( layer.buffer, 0, "buffer default is 0");
t.eq( layer.ratio, 1.5, "ratio default is 1.5");
t.eq( layer.numLoadingTiles, 0, "numLoadingTiles starts at 0");
t.ok( layer.events.listeners["tileloaded"] != null, "'tileloaded' event added to layer's event types");
@@ -47,7 +47,7 @@
function test_Layer_Grid_inittiles (t) {
t.plan( 2 );
var map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS(name, url, params);
layer = new OpenLayers.Layer.WMS(name, url, params, {buffer:2});
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0,0),5);
t.eq( layer.grid.length, 7, "Grid rows is correct." );