com.google.gwt.maps.client.overlay
Class MarkerOptions

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.maps.client.overlay.MarkerOptions

public class MarkerOptions
extends com.google.gwt.core.client.JavaScriptObject

Instances of this class are used in the Marker constructor options argument.


Nested Class Summary
static interface MarkerOptions.ZIndexProcess
          Interface defining function changing default z-Index order of the markers
 
Constructor Summary
protected MarkerOptions()
          JavaScript overlays require a protected constructor.
 
Method Summary
static MarkerOptions newInstance()
           
static MarkerOptions newInstance(Icon icon)
           
 void setAutoPan(boolean autoPan)
          Auto-pan the map as you drag the marker near the edge.
 void setBounceGravity(double bounceGravity)
          When finishing dragging, this number is used to define the acceleration rate of the marker during the bounce down to earth.
 void setBouncy(boolean bouncy)
          Toggles whether or not the marker should bounce up and down after it finishes dragging.
 void setClickable(boolean clickable)
          Toggles whether or not the marker is clickable.
 void setDragCrossMove(boolean dragCrossMove)
          When dragging markers normally, the marker floats up and away from the cursor.
 void setDraggable(boolean draggable)
          Toggles whether or not the marker will be draggable by users.
 void setIcon(Icon icon)
          Chooses the Icon for this class.
 void setTitle(java.lang.String title)
          This string will appear as tooltip on the marker, i.e.
 void setZIndexProcess(MarkerOptions.ZIndexProcess process)
          This function is used for changing the z-Index order of the markers when they are overlaid on the map and is also called when their infowindow is opened.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MarkerOptions

protected MarkerOptions()
JavaScript overlays require a protected constructor.

Method Detail

newInstance

public static MarkerOptions newInstance()

newInstance

public static MarkerOptions newInstance(Icon icon)

setAutoPan

public final void setAutoPan(boolean autoPan)
Auto-pan the map as you drag the marker near the edge. If the marker is draggable the default value for this option is true.

Parameters:
autoPan - true to turn on auto pan.

setBounceGravity

public final void setBounceGravity(double bounceGravity)
When finishing dragging, this number is used to define the acceleration rate of the marker during the bounce down to earth. The default value for this option is 1.

Parameters:
bounceGravity - number used to define the acceleration rate of the marker during the bounce.

setBouncy

public final void setBouncy(boolean bouncy)
Toggles whether or not the marker should bounce up and down after it finishes dragging. The default value for this option is false

Parameters:
bouncy - true to set the marker to be bouncy.

setClickable

public final void setClickable(boolean clickable)
Toggles whether or not the marker is clickable. Markers that are not clickable or draggable are inert, consume less resources and do not respond to any events. The default value for this option is true, i.e. if the option is not specified, the marker will be clickable.

Parameters:
clickable - whether or not the marker is clickable.

setDragCrossMove

public final void setDragCrossMove(boolean dragCrossMove)
When dragging markers normally, the marker floats up and away from the cursor. Setting this value to true keeps the marker underneath the cursor, and moves the cross downwards instead. The default value for this option is false.

Parameters:
dragCrossMove - set to true to keep the marker underneath the cursor when dragged.

setDraggable

public final void setDraggable(boolean draggable)
Toggles whether or not the marker will be draggable by users. Markers set up to be dragged require more resources to set up than markers that are clickable. Any marker that is draggable is also clickable, bouncy and auto-pan enabled by default. The default value for this option is false
Parameters:
draggable - whether or not the marker will be draggable by users.

setIcon

public final void setIcon(Icon icon)
Chooses the Icon for this class. If not specified, Icon.DEFAULT_ICON is used.

Parameters:
icon - sets the icon for this class.

setTitle

public final void setTitle(java.lang.String title)
This string will appear as tooltip on the marker, i.e. it will work just as the title attribute on HTML elements.

Parameters:
title - a string to set as the tooltip on the marker.

setZIndexProcess

public final void setZIndexProcess(MarkerOptions.ZIndexProcess process)
This function is used for changing the z-Index order of the markers when they are overlaid on the map and is also called when their infowindow is opened. The default order is that the more southerly markers are placed higher than more northerly markers. This function is passed in the Marker object and returns a number indicating the new z-index.

Parameters:
process - function used for changing the z-Index order of the markers