Example usage for com.google.gwt.maps.client.overlay HasMarker setPosition

List of usage examples for com.google.gwt.maps.client.overlay HasMarker setPosition

Introduction

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

Prototype

void setPosition(HasLatLng position);

Source Link

Usage

From source file:com.google.mobile.trippy.web.client.view.MapView.java

License:Apache License

/**
 * Create a new marker on the map.//from   w  ww .  j  ava 2s  . c  o  m
 * The marker is by default clickable and non-draggable
 */
@Override
public final HasMarker newMarker(HasLatLng position) {
    HasMarker marker = new Marker();
    marker.setPosition(position);
    marker.setMap(getMap());
    marker.setDraggable(false);
    marker.setClickable(true);
    marker.setIcon(new MarkerImage.Builder(TrippyBundle.INSTANCE.mapMarkerNormal().getURL()).build());
    if (markers == null) {
        markers = new ArrayList<HasMarker>();
    }
    markers.add(marker);
    return marker;
}