Search code examples
gwtgoogle-maps-api-3jsni

Google Maps v3 for GWT: How to use map.setControls(JsArray<MVCArray<Node>> controls)?


As you know the official Google Maps API v3 for GWT is announced here: https://groups.google.com/forum/#!topic/gwt-google-apis/6SO5kCDqb-k

I need to use the following method of GoogleMap class:

map.setControls(JsArray<MVCArray<Node>> controls) 

How do I construct the argument?

JsArray<MVCArray<Node>> controls 

For example, How to put a GWT Label on TOP_LEFT of the map?


Solution

  • TextBox textbox = new TextBox();
    textbox.setText("textbox123");
    MVCArray<Node> array = MVCArray.create();
    array.push(textbox.getElement());
    map.getControls().set((int)ControlPosition.RIGHT_TOP.getValue(), array);