Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Odd centering issue

Help
Rich
2007-07-09
2013-03-21
  • Rich
    Rich
    2007-07-09

    When I first display a map it centers correctly.  If I then display another map (and any map thereafter) that which should be the center point of the map is coincident with the upper left corner.  Namely, it is like the constructor is setting the coordinates of the upper left corner, instead of the center, on every may except the first.  Revelant code is as follows:

    (defaultZoom, latitude and longitude have already been defined)

    GMagt2Widget mapWidget = new GMap2Widget("800px", "950px", new GLatLng(latitude, longitude), defaultZoom, new GMapOptions());

    GMap2 map = mapWidget.getGmap();
    mapPanel.add(mapWidget);
    deckPanel.add(mapPanel);
    deckPanel.showWidget(0);
    rightPanel.add(deckPanel);
    dockPanel.add(rightPanel, dockPanel.EAST);
    RootPanel.get().add(dockPanel);

    Any ideas?