Hi NG!
i add controls to my map on startup, but i want to enable the user to
remove it again on runtime (toggle)
so i init my map like this:
private static MapTypeControl mapTypeControl = new MapTypeControl();
private static ScaleControl scaleControl = new ScaleControl();
public void onModuleLoad() {
...
mapWidget.addControl(mapTypeControl);
mapWidget.addControl(scaleControl);
...
}
further i got two functions to add/remove the controls via javascript:
public static void removeControls() {
Maps.logWrite("going to removeControls()");
mapWidget.removeControl(scaleControl);
mapWidget.removeControl(mapTypeControl);
Maps.logWrite("done");
}
public static void addControls() {
mapWidget.addControl(scaleControl);
mapWidget.addControl(mapTypeControl);
}
note: when i run the funtion via js, i even get the log! but the
control does not get removed.
/**
* all functions defined in this block will be visible as JavaScript
* functions in the map (html)
*/
public static native void exportStaticMethod() /*-{
$wnd.removeControls =
@at.biooffice.map.client.BioOffice3Map::removeControls();
$wnd.addControls =
@at.biooffice.map.client.BioOffice3Map::addControls();
}-*/;
any ideas whats going wrong?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---