Example usage for com.google.gwt.maps.client.overlays InfoWindow setPosition

List of usage examples for com.google.gwt.maps.client.overlays InfoWindow setPosition

Introduction

In this page you can find the example usage for com.google.gwt.maps.client.overlays InfoWindow setPosition.

Prototype

public final native void setPosition(LatLng position) ;

Source Link

Document

set Position

Usage

From source file:com.google.gwt.maps.testing.client.maps.ElevationMapWidget.java

License:Apache License

protected void drawInfoWindow(LatLng position, double elevation) {

    NumberFormat format = NumberFormat.getFormat("###");
    String elevationStr = format.format(elevation);
    String latlngStr = "[ " + format.format(position.getLatitude()) + ", "
            + format.format(position.getLongitude()) + " ]";
    String message = "Elevation " + elevationStr + "m @ " + latlngStr;

    HTML html = new HTML(message);
    InfoWindowOptions options = InfoWindowOptions.newInstance();
    options.setContent(html);//from   www . java 2  s . com
    InfoWindow iw = InfoWindow.newInstance(options);
    iw.setPosition(position);
    iw.open(mapWidget);
}