bounding box support
[gpl/argeo-suite.git] / org.argeo.app.geo / src / org / argeo / app / ol / VectorSource.java
index 3b60d0b91fba203550c15444d1b79a479e8d5720..122ef36025181b35f7cdc27fdbf582137b55d57c 100644 (file)
@@ -1,5 +1,7 @@
 package org.argeo.app.ol;
 
+import org.argeo.app.ux.js.JsReference;
+
 public class VectorSource extends Source {
 
        public VectorSource(Object... args) {
@@ -7,8 +9,17 @@ public class VectorSource extends Source {
        }
 
        public VectorSource(String url, FeatureFormat format) {
-               setUrl(url);
+               this(url, format, false);
+       }
+
+       public VectorSource(String url, FeatureFormat format, boolean bboxStrategy) {
                setFormat(format);
+               if (bboxStrategy) {
+                       setUrl(url);
+                       getNewOptions().put("strategy", new JsReference(getJsPackage() + ".bbox"));
+               } else {
+                       setUrl(url);
+               }
        }
 
        public void setUrl(String url) {