Example usage for com.google.gwt.maps.client.base HasLatLngBounds getJso

List of usage examples for com.google.gwt.maps.client.base HasLatLngBounds getJso

Introduction

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

Prototype

public JavaScriptObject getJso();

Source Link

Document

Gets the jso.

Usage

From source file:com.google.mobile.trippy.web.client.presenter.BaseMapPresenter.java

License:Apache License

protected void highlightResultIndex(final int index, final Item item, EventCallback eventCallback) {
    mapPresenter.setMarkerImage(currentItem, resultPinUrl);
    mapPresenter.setMarkerImage(index, TrippyBundle.INSTANCE.mapMarkerHighlighted().getURL());
    final HasLatLng point = mapPresenter.getLatLng(item.getLatitude(), item.getLongitude());
    HasLatLngBounds mapBounds = mapPresenter.getMapBounds();
    if (mapBounds.getJso() != null && !mapBounds.contains(point)) {
        mapPresenter.setCenter(point);//from ww  w.j av  a 2  s  .com
    }

    // show info window for highlighted item
    infoWindow.setContent(item.getName());
    infoWindow.setPosition(point);
    infoWindow.setClickHandler(eventCallback);
    infoWindow.open(null, null);
    currentItem = index;
}