Search in sources :

Example 1 with InfoWindowCloseClickHandler

use of com.google.gwt.maps.client.event.InfoWindowCloseClickHandler in project opennms by OpenNMS.

the class GoogleMapsPanel method showLocationDetails.

/** {@inheritDoc} */
@Override
public void showLocationDetails(final String name, final String htmlTitle, final String htmlContent) {
    final Marker m = m_markers.get(name);
    getMapWidget().savePosition();
    getMapWidget().setCenter(m.getLatLng());
    if (m != null) {
        final VerticalPanel panel = new VerticalPanel();
        panel.add(new Label(htmlTitle));
        panel.add(new HTML(htmlContent));
        getMapWidget().getInfoWindow().open(m.getLatLng(), new InfoWindowContent(panel.toString()));
        getMapWidget().getInfoWindow().addInfoWindowCloseClickHandler(new InfoWindowCloseClickHandler() {

            @Override
            public void onCloseClick(InfoWindowCloseClickEvent event) {
                getMapWidget().returnToSavedPosition();
            }
        });
    }
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) InfoWindowCloseClickHandler(com.google.gwt.maps.client.event.InfoWindowCloseClickHandler) Label(com.google.gwt.user.client.ui.Label) HTML(com.google.gwt.user.client.ui.HTML) Marker(com.google.gwt.maps.client.overlay.Marker) InfoWindowContent(com.google.gwt.maps.client.InfoWindowContent)

Aggregations

InfoWindowContent (com.google.gwt.maps.client.InfoWindowContent)1 InfoWindowCloseClickHandler (com.google.gwt.maps.client.event.InfoWindowCloseClickHandler)1 Marker (com.google.gwt.maps.client.overlay.Marker)1 HTML (com.google.gwt.user.client.ui.HTML)1 Label (com.google.gwt.user.client.ui.Label)1 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)1