List of usage examples for com.google.gwt.maps.client.base HasLatLngBounds contains
public boolean contains(HasLatLng point);
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);// www. ja va 2 s.co m } // show info window for highlighted item infoWindow.setContent(item.getName()); infoWindow.setPosition(point); infoWindow.setClickHandler(eventCallback); infoWindow.open(null, null); currentItem = index; }