2 import VectorSource
from 'ol/source/Vector.js';
3 import { bbox
} from 'ol/loadingstrategy';
4 import { transformToEpsg4326LatLonExtent
} from './OpenLayersUtils.js';
6 export default class BboxVectorSource
extends VectorSource
{
8 super(BboxVectorSource
.processOptions(options
));
11 static processOptions(options
) {
12 options
.strategy
= bbox
;
13 options
.url = function(extent
, resolution
, projection
) {
14 var bbox
= transformToEpsg4326LatLonExtent(extent
, projection
);
16 const baseUrl
= options
.baseUrl
;
17 // invert bbox order in order to have minLat,minLon,maxLat,maxLon as required by WFS 2.0.0
18 const url
= baseUrl
+ '&bbox=' + bbox
.join(',') + ',EPSG:4326';