BBOX Strategy is active for an inactive vector layer, r=pgiraud (pullup #3383)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@12126 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -87,7 +87,7 @@ OpenLayers.Strategy.BBOX = OpenLayers.Class(OpenLayers.Strategy, {
|
|||||||
"refresh": this.update,
|
"refresh": this.update,
|
||||||
scope: this
|
scope: this
|
||||||
});
|
});
|
||||||
if(this.layer.visibility == true) {
|
if(this.layer.visibility === true && this.layer.inRange === true) {
|
||||||
this.update();
|
this.update();
|
||||||
} else {
|
} else {
|
||||||
this.layer.events.on({
|
this.layer.events.on({
|
||||||
|
|||||||
@@ -280,7 +280,7 @@
|
|||||||
|
|
||||||
// Test fix for Ticket #3142
|
// Test fix for Ticket #3142
|
||||||
function test_layerLoadedAfterBeingAdded(t) {
|
function test_layerLoadedAfterBeingAdded(t) {
|
||||||
t.plan(1);
|
t.plan(2);
|
||||||
|
|
||||||
var dummy = new OpenLayers.Layer(null, {isBaseLayer: true});
|
var dummy = new OpenLayers.Layer(null, {isBaseLayer: true});
|
||||||
|
|
||||||
@@ -300,14 +300,23 @@
|
|||||||
projection: 'EPSG:900913'
|
projection: 'EPSG:900913'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Make sure that layers that are not in range don't request data
|
||||||
|
var layerOutOfRange = new OpenLayers.Layer.Vector(null, {
|
||||||
|
maxResolution: 1,
|
||||||
|
protocol: new OpenLayers.Protocol(),
|
||||||
|
strategies: [new OpenLayers.Strategy.BBOX()]
|
||||||
|
});
|
||||||
|
|
||||||
var map = new OpenLayers.Map("map");
|
var map = new OpenLayers.Map("map");
|
||||||
map.addLayer(dummy);
|
map.addLayer(dummy);
|
||||||
map.addLayer(layerReproject);
|
map.addLayer(layerReproject);
|
||||||
map.setCenter(new OpenLayers.LonLat(0, 0));
|
map.setCenter(new OpenLayers.LonLat(0, 0));
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
map.addLayer(layerOutOfRange);
|
||||||
// test that the strategy bounds were set
|
// test that the strategy bounds were set
|
||||||
t.ok(map.getExtent().equals(strategy.bounds), "[set center] bounds set to map extent");
|
t.ok(map.getExtent().equals(strategy.bounds), "[set center] bounds set to map extent");
|
||||||
|
t.eq(layerOutOfRange.strategies[0].bounds, null, "Data not requested if layer is out of range");
|
||||||
|
map.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user