Introduce tight integration with JavaScript classes
[gpl/argeo-suite.git] / org.argeo.app.geo / src / org / argeo / app / ol / View.java
diff --git a/org.argeo.app.geo/src/org/argeo/app/ol/View.java b/org.argeo.app.geo/src/org/argeo/app/ol/View.java
new file mode 100644 (file)
index 0000000..8ed2de3
--- /dev/null
@@ -0,0 +1,21 @@
+package org.argeo.app.ol;
+
+public class View extends AbstractOlObject {
+       public View(Object... args) {
+               super(args);
+       }
+
+       public void setCenter(int[] coord) {
+               if (isNew())
+                       getNewOptions().put("center", coord);
+               else
+                       executeMethod(getMethodName(), new Object[] { coord });
+       }
+
+       public void setZoom(int zoom) {
+               if (isNew())
+                       getNewOptions().put("zoom", zoom);
+               else
+                       executeMethod(getMethodName(), zoom);
+       }
+}