X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=js%2Fsrc%2Fgeo%2FBboxVectorSource.js;h=f0721ff001ac3412abc765f051dca1288544fe1f;hb=efda92d76cd7ccce3925763bf95f68d7927ac5c7;hp=49606b182e1f36ae27d768948e4801195c48b225;hpb=9cfc7842603c9c09d686ab9972099ed0a7c22a6e;p=gpl%2Fargeo-suite.git diff --git a/js/src/geo/BboxVectorSource.js b/js/src/geo/BboxVectorSource.js index 49606b1..f0721ff 100644 --- a/js/src/geo/BboxVectorSource.js +++ b/js/src/geo/BboxVectorSource.js @@ -1,7 +1,7 @@ import VectorSource from 'ol/source/Vector.js'; import { bbox } from 'ol/loadingstrategy'; -import { transformExtent } from 'ol/proj.js'; +import { transformToLatLonExtent } from './OpenLayersUtils.js'; export default class BboxVectorSource extends VectorSource { constructor(options) { @@ -11,13 +11,15 @@ export default class BboxVectorSource extends VectorSource { static processOptions(options) { options.strategy = bbox; options.url = function(extent, resolution, projection) { - const proj = projection.getCode(); - var bbox = transformExtent(extent, proj, 'EPSG:4326'); + var bbox = transformToLatLonExtent(extent, projection); const baseUrl = options.baseUrl; - const url = baseUrl + '&bbox=' + bbox.join(','); + // invert bbox order in order to have minLat,minLon,maxLat,maxLon as required by WFS 2.0.0 + const url = baseUrl + '&bbox=' + bbox.join(',') + ',EPSG:4326'; return url; } return options; } + + } \ No newline at end of file