[OpenLayers-Trac] [OpenLayers] #3383: BBOX Strategy is active for
an inactive vector layer
OpenLayers
trac-20090302 at openlayers.org
Thu Jun 23 13:45:20 EDT 2011
#3383: BBOX Strategy is active for an inactive vector layer
-----------------------------------+----------------------------------------
Reporter: bombdog | Owner: tschaub
Type: bug | Status: new
Priority: minor | Milestone: 2.11 Release
Component: Strategy.BBOX | Version: 2.11 RC1
Keywords: maxResolution ignored | State:
-----------------------------------+----------------------------------------
Upon upgrading from 2.10 to 2.11RC1 I notice that an inactive vector layer
is loading vector data from the server. This happens as the map is
initialising. I've been using a simple technique to switch from raster
overlays to vector overlays of the same data as the user goes deeper into
the map. The maxResolution is set so that the vector layer comes on at
about zoom level 11. For example:
//Vector overlay - for high zooms
var vProtocol = new OpenLayers.Protocol.MapFish({
'url': '/map/vectorservice',
'format': new OpenLayers.Format.GeoJSON()
});
var bbox = new OpenLayers.Strategy.BBOX();
var vl = new OpenLayers.Layer.Vector(
'My vector layer',
{
maxResolution:38.219,
protocol: vProtocol,
strategies: [bbox]
}
);
The starting resolution of the map is much greater than the maxResolution,
but a request still goes to my server and tries to download all the
available data. Obviously that's what I want to avoid, I want to load
small BBOXes at high zooms. Something is triggering BBOX.update() at the
point the map is initialized, regardless of the value of maxResolution.
This did not happen in earlier releases.
--
Ticket URL: <http://trac.openlayers.org/ticket/3383>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list