Example usage for com.google.gwt.maps.client.base LatLngBounds getCenter

List of usage examples for com.google.gwt.maps.client.base LatLngBounds getCenter

Introduction

In this page you can find the example usage for com.google.gwt.maps.client.base LatLngBounds getCenter.

Prototype

public final native LatLng getCenter() ;

Source Link

Document

Computes the center of this LatLngBounds

Usage

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

License:Open Source License

public void showMarkers() {
    if (getSensorMarkers().size() != 0) {
        LatLngBounds bounds = null;

        for (SensorInfoDisplay marker : getSensorMarkers()) {
            if (bounds == null) {
                bounds = LatLngBounds.newInstance(marker.getLatLng(), marker.getLatLng());
            } else {

                bounds.extend(marker.getLatLng());
            }//from ww w .j a  va  2s.  c  o m
        }
        LatLng center = bounds.getCenter();
        getMap().setCenter(center);
        getMap().fitBounds(bounds);

        //populateMenuItems();
        SensorGroupMarker.showMarkers();

    }

    if (getSelectedSensor() != null) {
        SensorGroupMarker.setSelectedSensor(getSelectedSensor());
    }
}