Re: autozise on google maps display

2008-09-08 Thread Sudhindra HS
Adding window listener and then calculating the the height and width of the
panel works.

thanks for the help.

On Fri, Sep 5, 2008 at 8:43 PM, Eric Ayers [EMAIL PROTECTED] wrote:


 I didn't see your call to Window.addWindowResizeListener() as shown in
 the FAQ (and the Mail example0

 If you want to get the current size of the window, use
 Window.getClientWidth() and Window.getClientHeight().

 On Fri, Sep 5, 2008 at 10:53 AM, neversaydie [EMAIL PROTECTED] wrote:
 
  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-5s=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/
  
 



 --
 Eric Z. Ayers - GWT Team - Atlanta, GA USA
 http://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 Google-Web-Toolkit@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: autozise on google maps display

2008-09-05 Thread neversaydie

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-5s=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 Google-Web-Toolkit@googlegroups.com
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
-~--~~~~--~~--~--~---