Hi there
I tried the new Overlay-Functionality, I tried to implement a MapPanel
withe the new JavascriptObject Overlay Functionality, heres my source.
GMap2.java
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.Element;
public class GMap2 extends JavaScriptObject {
protected GMap2() {
}
public static native GMap2 GMap2(Element element) /*-{
return new $wnd.GMap2(element);
}-*/;
public final native void setCenter(GLatLng GLatLng, int center) /
*-{
this.setCenter(GLatLng, center);
}-*/;
}
GLatLng.java
import com.google.gwt.core.client.JavaScriptObject;
public class GLatLng extends JavaScriptObject {
protected GLatLng() {
}
public final static native GLatLng GLatLng(Double lat, Double
lng) /*-{
return new $wnd.GLatLng(lat, lng);
}-*/;
}
MapPanel.java
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Widget;
public class MapPanel extends Widget {
private static int nextID = 0;
private GMap2 GMap2;
public MapPanel(PartyMap controller) {
setElement(DOM.createDiv());
getElement().setId("PartyMap" + ++nextID);
setWidth("100%");
setHeight("100%");
}
@Override
public void onLoad() {
GMap2 = GMap2.GMap2(getElement());
GMap2.setCenter(GLatLng.GLatLng(49.01, 8.4), 13);
}
}
When I add this Widget to my Rootpanel (GoogleMaps Scriptfile included
of course), I get a broken Map, small and always grey. Where is my
mistake?
Also, if I move the GMap2.java and GLatLng.java to another package and
include them in MapPanel.java, I get an error, saying, the import
cannot be resolved.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---