Well I have two classes one for gis
public class GIS extends Panel {
private Map map;
private Panel center;
private Panel mapPanel;
public GIS(Map map) {
this.map = map;
buildUI();
}
private void buildUI() {
center = new Panel();
center.setLayout( new HorizontalLayout( 1 ) );
center.add( getMapPanel() );
this.add( center );
}
private Panel getMapPanel() {
mapPanel= new HTMLPanel();
mapPanel.setTitle( "gis" );
mapPanel.add( map );
return mapPanel;
}
}
And another,
public class Map extends Composite implements MapZoomEndHandler,
MapDragEndHandler {
private static final LatLng latLng= new
LatLng( 53.99328979251845D, -1.53626203536987D );
private static final int zoom = 7;
private MapWidget mapWidget;
private HorizontalPanel horizontalPanel;
private InfoWindow infoWindow;
private static final String DEFAULT_WIDTH = "1224px";
private static final String DEFAULT_HEIGHT = "1224px";
public Map() {
this( DEFAULT_WIDTH, DEFAULT_HEIGHT );
}
public Map( String width, String height ) {
initWidget( getHorizontalPanel( width, height ) );
}
public HorizontalPanel getHorizontalPanel( String width, String
height ) {
horizontalPanel = new HorizontalPanel();
horizontalPanel.setSize( "100%", "100%" );
horizontalPanel.add( getMapWidget( width, height ) );
return horizontalPanel;
}
public MapWidget getMapWidget( String width, String height ) {
mapWidget = new MapWidget( latLng, zoom );
mapWidget.addMapZoomEndHandler( this );
mapWidget.addControl( new SmallMapControl() );
mapWidget.setScrollWheelZoomEnabled( true );
mapWidget.setSize( width, height );
mapWidget.setVisible( true );
mapWidget.checkResize();
return mapWidget;
}
public MapWidget getMapWidget() {
return mapWidget;
}
public void onZoomEnd( MapZoomEndEvent event ) {
mapWidget.checkResize();
}
public void onDragEnd( MapDragEndEvent event ) {
mapWidget.checkResize();
}
now map will be added to gis and the gis will be wrapped inside
another panel with bordelayout position=center
now the map should be shown with 30% width and 30% height on right
corner bottom of the window.
I am struggling at this point to set the appropriate height and width
based on monitor size. Can any one suggest me a lay out for this ?
I dont want to initialize my mapwidget with large pixel values.
On Sep 5, 3:09 pm, "Eric Ayers" <[EMAIL PROTECTED]> wrote:
> The GWT faq shows you how to create an app that spans 100% width and
> height by installing a Window resize handler. did you try that?
>
> http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=goog...
>
>
>
> On Fri, Sep 5, 2008 at 10:03 AM,neversaydie<[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I need to develop some layout exactly as the maps.google.com.
>
> > The problem is getting the maps size correct across the different
> > sized monitors.
>
> > i tried setting 100% 100% as width and height, but that does not seem
> > to be working.
>
> > can anyone help me on this issue? I did see the google maps FAQ. that
> > does not help either.
>
> --
> Eric Z. Ayers - GWT Team - Atlanta, GA USAhttp://code.google.com/webtoolkit/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---