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:
@@ -74,11 +74,11 @@
|
||||
function test_Layer_MapServer_inittiles (t) {
|
||||
t.plan( 2 );
|
||||
var map = new OpenLayers.Map('map');
|
||||
layer = new OpenLayers.Layer.MapServer(name, url, params);
|
||||
layer = new OpenLayers.Layer.MapServer(name, url, params, {buffer: 0});
|
||||
map.addLayer(layer);
|
||||
map.setCenter(new OpenLayers.LonLat(0,0),5);
|
||||
t.eq( layer.grid.length, 7, "Grid rows is correct." );
|
||||
t.eq( layer.grid[0].length, 6, "Grid cols is correct." );
|
||||
t.eq( layer.grid.length, 4, "Grid rows is correct." );
|
||||
t.eq( layer.grid[0].length, 3, "Grid cols is correct." );
|
||||
map.destroy();
|
||||
|
||||
}
|
||||
@@ -234,7 +234,7 @@
|
||||
var map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.Google("Google");
|
||||
map.addLayer(layer);
|
||||
layer = new OpenLayers.Layer.MapServer(name, url, params, {isBaseLayer: false, reproject: true});
|
||||
layer = new OpenLayers.Layer.MapServer(name, url, params, {isBaseLayer: false, reproject: true, buffer: 2});
|
||||
layer.isBaseLayer=false;
|
||||
map.addLayer(layer);
|
||||
map.setCenter(new OpenLayers.LonLat(0,0), 5);
|
||||
@@ -251,7 +251,7 @@
|
||||
}
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
layer = new OpenLayers.Layer.MapServer(name, url, params);
|
||||
layer = new OpenLayers.Layer.MapServer(name, url, params, {buffer:2});
|
||||
map.addLayer(layer);
|
||||
map.setCenter(new OpenLayers.LonLat(0,0), 5);
|
||||
var tile = layer.grid[0][0];
|
||||
|
||||
Reference in New Issue
Block a user