Example usage for com.google.gwt.maps.client.overlays InfoWindowOptions setDisableAutoPan

List of usage examples for com.google.gwt.maps.client.overlays InfoWindowOptions setDisableAutoPan

Introduction

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

Prototype

public final native void setDisableAutoPan(boolean disableAutoPan) ;

Source Link

Document

sets Disable auto-pan on open.

Usage

From source file:gov.nist.spectrumbrowser.client.SensorGroupMarker.java

License:Open Source License

public InfoWindow getInfoWindow(String message) {
    if (infoWindow == null) {
        LatLng northeast = SpectrumBrowserShowDatasets.getMap().getBounds().getNorthEast();
        LatLng southwest = SpectrumBrowserShowDatasets.getMap().getBounds().getSouthWest();
        double delta = northeast.getLatitude() - southwest.getLatitude();
        int height = SpectrumBrowser.MAP_HEIGHT;
        // should be the height of the icon.
        int desiredPixelOffset = 15;
        double latitudeOffset = delta / height * desiredPixelOffset;
        InfoWindowOptions iwo = InfoWindowOptions.newInstance();
        iwo.setPosition(LatLng.newInstance(lat + latitudeOffset, lon));
        iwo.setDisableAutoPan(true);
        iwo.setContent(message);/*w  w  w.j  av a2 s . c  om*/
        infoWindow = InfoWindow.newInstance(iwo);
    }
    return infoWindow;
}

From source file:gov.nist.spectrumbrowser.client.SensorInfoDisplay.java

License:Open Source License

public InfoWindow getInfoWindow() {
    LatLng northeast = SpectrumBrowserShowDatasets.getMap().getBounds().getNorthEast();
    LatLng southwest = SpectrumBrowserShowDatasets.getMap().getBounds().getSouthWest();
    double delta = northeast.getLatitude() - southwest.getLatitude();
    int height = SpectrumBrowser.MAP_HEIGHT;
    // should be the height of the icon.
    int desiredPixelOffset = 15;
    double latitudeOffset = delta / height * desiredPixelOffset;
    InfoWindowOptions iwo = InfoWindowOptions.newInstance();

    iwo.setPosition(LatLng.newInstance(getLatLng().getLatitude() + latitudeOffset, getLatLng().getLongitude()));
    iwo.setDisableAutoPan(true);
    iwo.setContent(sensorInfo.getSensorDescription());
    return InfoWindow.newInstance(iwo);
}