GWT MAP 3.8 (Google API) - Is onResize () necessary to hide the gray background?

My problem:
 - I display a map inside the popup and I have unloaded tiles (gray background). - If I zoom in or out, then the map will fill the entire space (no gray background anymore).

My question is:
 - Do you have any ideas about my problem (if I need to resize to hide the "gray background")?
 - I do not know if I should call onResize () inside the Runnable callback (code above) or not?

Thank,

My actual code: (I am using javaxLoaderAPI)

// INPUT POINT

  GoogleMap map;
  @UiField LayoutPanel gmap;

  public void AjaxLoader_MAP() {

          AjaxLoaderOptions options = AjaxLoaderOptions.newInstance();

          options.setOtherParms("key=***&sensor=false&language=es");

          Runnable callback = new Runnable() {
             public void run() {
                gmap.onResize();         // Should I call onResize() here  ? 
                map = GoogleMap.create(gmap.getElement());    
             };
          }

          AjaxLoader.loadApi("maps", "3", callback, options);
 }
+5
source share
2 answers
+1

mapWidget.triggerResize() (Timer.schedule()), reset, .

:

@Override
protected void onReset() {
    super.onReset();
    Timer timer = new Timer() {
        @Override
        public void run() {
            triggerResize();
        }
    };
    timer.schedule(100);
}

. , - - .

0

All Articles