1. Todor Todorov
  2. GWT-OpenLayers

Commits

Todor Todorov  committed 952ad58

added methods getLonLat, move to and panintoview

  • Participants
  • Parent commits 726227e
  • Branches default

Comments (0)

Files changed (2)

File gwt-openlayers-client/src/main/java/org/gwtopenmaps/openlayers/client/popup/Popup.java

View file
 
 import org.gwtopenmaps.openlayers.client.LonLat;
 import org.gwtopenmaps.openlayers.client.OpenLayersObjectWrapper;
+import org.gwtopenmaps.openlayers.client.Pixel;
 import org.gwtopenmaps.openlayers.client.Size;
 import org.gwtopenmaps.openlayers.client.util.JSObject;
 
         this.getJSObject().setProperty("lonlat", lt.getJSObject());
     }
 
+    public LonLat getLonLat()
+    {
+    	return LonLat.narrowToLonLat(this.getJSObject().getProperty("lonlat"));
+    }
+
     /**
      * Method: show Makes the popup visible.
      */
     }
 
     /**
+     * Method: moveTo
+     *
+     * @param px - {<OpenLayers.Pixel>} the top and left position of the popup div.
+     */
+    public void moveTo(Pixel px) {
+        PopupImpl.moveTo(getJSObject(), px.getJSObject());
+    }
+
+    /**
+     * Method: panIntoView
+     * Pans the map such that the popup is totaly viewable (if necessary)
+     */
+    public void panIntoView() {
+    	PopupImpl.panIntoView(getJSObject());
+    }
+
+    /**
      * APIMethod: updateSize
      * Auto size the popup so that it precisely fits its contents (as
      * determined by this.contentDiv.innerHTML). Popup size will, of

File gwt-openlayers-client/src/main/java/org/gwtopenmaps/openlayers/client/popup/PopupImpl.java

View file
         p.updatePosition();
     }-*/;
 
+    public static native void moveTo(JSObject p, JSObject px) /*-{
+        p.moveTo(px);
+    }-*/;
+
+    public static native void panIntoView(JSObject p) /*-{
+        p.panIntoView();
+    }-*/;
+
     public static native void updateSize(JSObject p) /*-{
         p.updateSize();
     }-*/;