List of usage examples for com.google.gwt.maps.client InfoWindow isVisible
public boolean isVisible()
true if the info window is visible. From source file:com.google.livingstories.client.lsp.views.contentitems.LocationView.java
License:Apache License
private MapWidget createMap() { final String description = location.getDescription(); LatLng latLng = LatLng.newInstance(location.getLatitude(), location.getLongitude()); final MapWidget map = new MapWidget(latLng, MAPS_ZOOM); map.setSize(MAPS_WIDTH + "px", MAPS_HEIGHT + "px"); map.addControl(new SmallMapControl()); map.setDoubleClickZoom(true);//from w ww. j a v a 2s. com map.setDraggable(true); map.setScrollWheelZoomEnabled(true); if (!description.isEmpty()) { final Marker marker = new Marker(latLng); map.addOverlay(marker); final InfoWindowContent iwc = new InfoWindowContent(description); marker.addMarkerClickHandler(new MarkerClickHandler() { @Override public void onClick(MarkerClickEvent event) { InfoWindow infoWindow = map.getInfoWindow(); if (infoWindow.isVisible()) { infoWindow.close(); } else { infoWindow.open(marker, iwc); } } }); map.setTitle(description); } return map; }