Reputation: 339
Given this example http://openlayers.org/en/v3.0.0/examples/vector-wfs.js and using BBOX strategy , does it mean it is necessary to use &bbox=' + extent.join(',')
part in source URL?
The OpenLayers3 Strategy BBOX strategy says “request new features whenever the map bounds are outside the bounds of the previously requested set of features.”
Upvotes: 1
Views: 4330
Reputation: 12581
Yes, the &bbox=' + extent.join(',')
if required. If you take it out, you will get no wfs features at all. The example is actually somewhat misleading, in that, it calls it a BBOX strategy, whereas in fact it is a createTile
strategy, using the BBOX from each underlying tile, as the wfs BBOX. If you look internally at the source code for ol.source.ServerVector you will find a function loadFeatures
that calls ol.loadingstrategy.createTile
from ol.loadingstrategy which returns the required extents for each tile, which is then used for each wfs call. That is the extent that you see in the extent.join above.
Or to look at it another way, for every call to get an imagery tile, there is a corresponding call to a wfs tile -- which you can verify by looking in the network tab of your browser's dev tools. So, really, this is a tile BBOX strategy, not a view BBOX strategy.
I thoroughly recommend getting local debugging working for OL3 to understand what is going on. You can do that either by loading ol-debug.js, for a non-compressed version of the js, or by setting up a local server, see these instructions
Upvotes: 3