]>
git.argeo.org Git - gpl/argeo-suite.git/blob - js/src/geo/BboxVectorSource.js
2 import VectorSource
from 'ol/source/Vector.js';
3 import { bbox
} from 'ol/loadingstrategy';
4 import { transformToLatLonExtent
} 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
= transformToLatLonExtent(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';