@Override public void setContent(String content) { infoWindow.setContent(content); }
public InfoWindowDelegate() { this.infoWindow = new GoogleMapInfoWindow(); }
@Override public String getContent() { return infoWindow.getContent(); }
/** * Sets the contents of an info window to a single Vaadin component which may, * of course, be a layout. * * @param window the info window which contents should be modified * @param content the contents for the info window */ public void setInfoWindowContents(GoogleMapInfoWindow window, Component content) { super.addComponent(content); infoWindowContents.put(window, content); String contentIdentifier = "content-for-infowindow-" + window.getId(); content.addStyleName(contentIdentifier); window.setContent("Loading..."); getState().infoWindowContentIdentifiers .put(window.getId(), contentIdentifier); }
/** * Opens an info window. * * @param infoWindow The window to open. */ public void openInfoWindow(GoogleMapInfoWindow infoWindow) { getState().infoWindows.put(infoWindow.getId(), infoWindow); }
@Override public Integer getPixelOffsetHeight() { return infoWindow.getPixelOffsetHeight(); }
@Override public Integer getPixelOffsetWidth() { return infoWindow.getPixelOffsetWidth(); }
@Override public String getHeight() { return infoWindow.getHeight(); }
@Override public GeoPoint getPosition() { return GeoPointDelegate.fromLatLon(infoWindow.getPosition()); }
@Override public Marker getAnchorMarker() { return new MarkerDelegate(infoWindow.getAnchorMarker()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } InfoWindowDelegate other = (InfoWindowDelegate) obj; return infoWindow.equals(other.getInfoWindow()); } }
/** * Checks if an info window is open. * * @param infoWindow The window to check. * @return true, if the window is open. */ public boolean isInfoWindowOpen(GoogleMapInfoWindow infoWindow) { return getState(false).infoWindows.containsKey(infoWindow.getId()); }
/** * Closes an info window. * * @param infoWindow The window to close. */ public void closeInfoWindow(GoogleMapInfoWindow infoWindow) { getState().infoWindows.remove(infoWindow.getId()); }
@Override public InfoWindow createInfoWindow(String content) { return new InfoWindowDelegate(new GoogleMapInfoWindow(content)); }
@Override public InfoWindow createInfoWindow(String content, Marker anchorMarker) { return new InfoWindowDelegate(new GoogleMapInfoWindow(content, ((MarkerDelegate) anchorMarker).getMarker())); }