use of com.google.gwt.maps.client.overlay.Marker in project opennms by OpenNMS.
the class GoogleMapsPanel method createMarker.
private Marker createMarker(final GWTMarkerState marker) {
final Icon icon = Icon.newInstance();
icon.setIconSize(Size.newInstance(32, 32));
icon.setIconAnchor(Point.newInstance(16, 32));
String markerImageURL = marker.getImageURL();
icon.setImageURL(markerImageURL);
final MarkerOptions markerOptions = MarkerOptions.newInstance();
markerOptions.setAutoPan(true);
markerOptions.setClickable(true);
markerOptions.setTitle(marker.getName());
markerOptions.setIcon(icon);
Marker m = new Marker(toLatLng(marker.getLatLng()), markerOptions);
m.setVisible(marker.isVisible());
m.addMarkerClickHandler(new DefaultMarkerClickHandler(marker));
return m;
}
use of com.google.gwt.maps.client.overlay.Marker 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();
}
});
}
}
use of com.google.gwt.maps.client.overlay.Marker in project opennms by OpenNMS.
the class GoogleMapsPanel method placeMarker.
/** {@inheritDoc} */
@Override
public void placeMarker(final GWTMarkerState marker) {
m_markerStates.put(marker.getName(), marker);
Marker m = m_markers.get(marker.getName());
if (m == null) {
m = createMarker(marker);
m_markers.put(marker.getName(), m);
addOverlay(m);
}
updateMarkerFromState(m, marker);
}
Aggregations