Search in sources :

Example 1 with Icon

use of com.google.gwt.maps.client.overlay.Icon 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;
}
Also used : MarkerOptions(com.google.gwt.maps.client.overlay.MarkerOptions) Icon(com.google.gwt.maps.client.overlay.Icon) Marker(com.google.gwt.maps.client.overlay.Marker)

Aggregations

Icon (com.google.gwt.maps.client.overlay.Icon)1 Marker (com.google.gwt.maps.client.overlay.Marker)1 MarkerOptions (com.google.gwt.maps.client.overlay.MarkerOptions)1