Example usage for com.google.gwt.maps.client.overlay MarkerOptions setAutoPan

List of usage examples for com.google.gwt.maps.client.overlay MarkerOptions setAutoPan

Introduction

In this page you can find the example usage for com.google.gwt.maps.client.overlay MarkerOptions setAutoPan.

Prototype

public final native void setAutoPan(boolean autoPan) ;

Source Link

Document

Auto-pan the map as you drag the marker near the edge.

Usage

From source file:org.opennms.features.poller.remote.gwt.client.GoogleMapsPanel.java

License:Open Source License

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);/*from w w  w. j a  v a  2  s. c om*/

    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;
}