@@ -37,7 +37,7 @@ import {
3737import GML2Format from "ol/format/GML2" ;
3838import GeoJSONFormat from "ol/format/GeoJSON" ;
3939import EsriJsonFormat from "ol/format/EsriJSON" ;
40- import { tile , bbox } from "ol/loadingstrategy" ;
40+ import { tile , bbox , all } from "ol/loadingstrategy" ;
4141import VectorSource from "ol/source/Vector" ;
4242import VectorLayer from "ol/layer/Vector" ;
4343import { createXYZ } from "ol/tilegrid" ;
@@ -78,6 +78,12 @@ function defineSource(mapSource) {
7878 format = GeoJSONFormat ;
7979 }
8080
81+ const strategyName = mapSource . config ?. strategy ;
82+ let strategy = bbox ;
83+ if ( strategyName === 'all' ) {
84+ strategy = all ;
85+ }
86+
8187 // TODO: Ensure this gets the real map projection when
8288 // the code supports alternative projections.
8389 const mapProjection = "EPSG:3857" ;
@@ -94,12 +100,6 @@ function defineSource(mapSource) {
94100 ) ;
95101 }
96102
97- const queryExtent = transformExtent (
98- extent ,
99- mapProjection ,
100- queryProjection
101- ) ;
102-
103103 const urlParams = Object . assign (
104104 { } ,
105105 {
@@ -108,14 +108,21 @@ function defineSource(mapSource) {
108108 service : "WFS" ,
109109 version : "1.1.0" ,
110110 request : "GetFeature" ,
111- bbox : queryExtent ,
112111 } ,
113112 mapSource . params
114113 ) ;
115114
115+ if ( strategy === bbox ) {
116+ const queryExtent = transformExtent (
117+ extent ,
118+ mapProjection ,
119+ queryProjection
120+ ) ;
121+ urlParams . bbox = queryExtent ;
122+ }
116123 return joinUrl ( mapSource . urls [ 0 ] , urlParams ) ;
117124 } ,
118- strategy : bbox ,
125+ strategy,
119126 } ;
120127 } else if ( mapSource . type === "geojson" ) {
121128 return {
0 commit comments