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

前端 未结 2 1492
天命终不由人
天命终不由人 2021-01-24 16:23

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.trig

相关标签:
2条回答
  • 2021-01-24 16:42

    That's the best I found so far:

    private final native void resizeMap(GoogleMap map) /*-{
        $wnd.google.maps.event.trigger(map, 'resize');
    }-*/;
    
    0 讨论(0)
  • 2021-01-24 16:53

    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

    0 讨论(0)
提交回复
热议问题