Malte
Malte

Reputation: 152

trigger resize Event to Google Maps from GWT 2.5 using "gwt-maps-3.8.0"

Using gwt-maps-3.8.0 lib GWT-Maps and i am not able to trigger a resize.

-> tried using "import com.google.gwt.user.client.Event;" -> Event.trigger(mapWidget,"resize"); "The method trigger(GoogleMap, String) is undefined for the type Event"

(this is the follow up from here: second call of google maps does not show the map in correct size)

Upvotes: 1

Views: 1495

Answers (2)

Stefan Arn
Stefan Arn

Reputation: 1154

If you don't want to use your own nativ JS code you could just use the mapWidget.getMap().triggerResize() method provided by the gwt-maps-3.8.0 library

Upvotes: 2

Laurent Grégoire
Laurent Grégoire

Reputation: 4146

That's the best I found so far:

private final native void resizeMap(GoogleMap map) /*-{
    $wnd.google.maps.event.trigger(map, 'resize');
}-*/;

Upvotes: 2

Related Questions