Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4097112
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:07:55+00:00 2026-05-20T20:07:55+00:00

I am trying to add MapWidget to VerticalPanel but the map added on the

  • 0

I am trying to add MapWidget to VerticalPanel but the map added on the
left corner:

Screenshot

And I added marker and the marker should be centered on the image
I can’t see the marker when I load the map. I should navigate to this
location to show map.

The code for this

private FormPanel form = new FormPanel();

private VerticalPanel main = new VerticalPanel();



public Map(){

  ScrollPanel container = new ScrollPanel();

  initWidget(container);

  container.setStyleName("FuoEgForm");

  form.setWidget(main);

  main.setSpacing(6);

  container.add(main);
}

public MapWidget addMapWidget(){

  MapWidget map = new MapWidget();

  //map.setSize("100%", "100%");
  map.setStyleName("gwt-map");
  map.removeMapType(MapType.getNormalMap());
  map.removeMapType(MapType.getSatelliteMap());
  map.addMapType(MapType.getPhysicalMap());
  map.addMapType(MapType.getHybridMap());
  map.setCurrentMapType(MapType.getHybridMap());

  //map.setSize("100%", "100%");
  map.setWidth("500px");
  map.setHeight("500px");
  main.add(map);

}

How can I solve this issue? The map should fill the gray
boundary?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:07:55+00:00Added an answer on May 20, 2026 at 8:07 pm

    As of gwt-maps-1.1, the MapWidget implements the RequiresResize interface. When added to a panel that supports this interface (such as DockLayoutPanel), the widget automatically calls map.checkResizeAndCenter() whenever the panel containing the widget is resized. This new feature makes it possible to set your map size to 100% in both directions and fill up the available space on the screen. To use LayoutPanel subclasses properly, make sure your html page is set to use standards mode by adding as the first line in the document.

    In gwt-maps 1.0, it may be necessary to force the map to resize its layout after the map is initially added. you can use the MapWidget.checkResizeAndCenter() method to clean this up. You may need to delay calling this function using a DeferredCommand or other mechanism to wait until after the DOM layout pass that resizes the map is called.

    or you can find unexpected another unexpected reason that happened with me

    i made the map invisible @constructor
    and then set it visible if clicked on a button

    the solution
    make the map always visible 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to add an onclick handler to my tabs, and can't seem to get
I'm trying to add support for stackoverflow feeds in my rss reader but SelectNodes
I'm trying add vertical lines to my grid. I have found some examples but
Im trying to add a dot like • for a dot product but it
I am trying to add an object to an arraylist but when I view
I'm trying to add a_folder to SVN but I accidentally scheduled my root directory
I'm trying to add In-App Purchase to my iPhone app. But when i run
I'm trying to add css styling to Facebook Like Box XFBML file but it
I'm trying add a tab to my web page that looks like this: Using
trying to add an ExpiresDefault ExpiresByType to content on my website so that way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.