1. #1
    Ext GWT Premium Member
    Join Date
    Aug 2010
    Posts
    13
    Vote Rating
    0
    eburgerwa is on a distinguished road

      0  

    Thumbs up Rendering Google MAPS in GXT

    Rendering Google MAPS in GXT


    Hi,

    I am quite sure I am missing something rather elementary here, and hope someone can help me.

    When I use GWT's dockpanel as the enclosing container, the Google Map renders just fine. When, however, i use GXT's LayoutContainer, it does not render. What am I doing wrong?

    I am using GXT 2.2.1, GWT 2.1.0 and ver 1.1.0 of the GWT Maps API.

    Thank you in advance for any help.

    Here is the code snippet in question.

    The onModuleLoad method:
    public void onModuleLoad() {

    // final DockLayoutPanel dock = new DockLayoutPanel(Unit.PX);
    LayoutContainer container = new LayoutContainer();
    container.setSize(500, 500);

    Maps.loadMapsApi("my_key", "2", false, new MapRunnable(container));

    RootPanel.get().add(container);
    container.layout();
    }


    public class MapRunnable implements Runnable
    {
    DockLayoutPanel dock = null;
    LayoutContainer container = null;

    /**
    * @param map
    */
    public MapRunnable(DockLayoutPanel dock)
    {
    this.dock = dock;
    }

    public MapRunnable(LayoutContainer container)
    {
    this.container = container;
    }

    MapWidget map;

    /* (non-Javadoc)
    * @see java.lang.Runnable#run()
    */
    @Override
    public void run()
    {
    buildMap();

    }



    private void buildMap()
    {
    Window.alert("Google Maps loaded!");

    LatLng seattle = LatLng.newInstance(47.45, -122.30);

    map = new MapWidget(seattle, 2);
    map.setPixelSize(500, 500);
    map.addControl(new LargeMapControl());

    map.addOverlay(new Marker(seattle));

    // Add an info window to highlight a point of interest
    map.getInfoWindow().open(map.getCenter(), new InfoWindowContent("Seattle"));

    // dock.addNorth(map, 500);
    container.add(map);
    }

    }

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    After
    Code:
    container.add(map);
    try to call
    Code:
    container.layout();

  3. #3
    Ext GWT Premium Member
    Join Date
    Aug 2010
    Posts
    13
    Vote Rating
    0
    eburgerwa is on a distinguished road

      0  

    Default


    Hello Sven,

    Thank you very much - that solved the problem. Any pointers to GXT documentation on where we need to call layout and where not?

    Cheers
    Eugene

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Everytime you modify a container (add or remove) you need to call it.

Similar Threads

  1. Google Maps
    By Gamer in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 1 Oct 2010, 11:50 AM
  2. Problem with Google maps
    By tombal93 in forum Ext 3.x: User Extensions and Plugins
    Replies: 0
    Last Post: 30 Sep 2010, 11:36 AM
  3. Markers and Google maps
    By Simonhayre in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 7 Jul 2010, 12:21 PM
  4. Google Maps in tabs?
    By JoomlaMan in forum Ext 2.x: Help & Discussion
    Replies: 12
    Last Post: 11 May 2009, 1:50 PM
  5. [Desktop 2.0] Live-Maps / Google-Maps Module v0.1
    By franckxx in forum Community Discussion
    Replies: 10
    Last Post: 22 Mar 2008, 1:00 AM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar