Hi,
I'm trying to use OpenLayers in Gwt, but I don't know to make
something. I want that everytime a user press a button, the
application create new panel a put a map there.
I don't know how to do it even in JS.
Currently my approach is somthing like this:
public class X {
public onClick() {
Label x = new Label();
x.getElement().setId("mymap");
panel.add(x);
MyJsHelp.createMap("mymap");
}
}
public class MyJsHelp {
public native void MyJsHelp(String s) /*-{
var map = new $wnd.OpenLayers.Map("mymap");
....
}-*/
}
The problem is that this code doesn't work, and I think it's because
Gwt is not creating the label before createMap is called.
If I execute the line:
MyJsHelp.createMap("mymap");
In another event, and after creating the div, the code works.
Any ideas? Adding a listener to draw after rendering? Force Gwt to
create the label before createMap is called?
Thanks in advance,
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---