A Marker is an icon placed at a point on the map’s surface. Markers may optionally have a text title displayed alongside the icon. The Marker is displayed so that it is always oriented to align with the device’s screen, regardless of how the user moves or rotates the map.
Markers avoid being displayed such that one marker visually overlaps another. Instead, for any set of markers, some may be temporarily hidden so that none are displayed intersecting another. The decision about which markers to hide when markers overlap is based on the drawOrder property of each marker.
To create a Marker and add it to the map, use EegeoMap.addMarker()
Marker has the following properties:
The LatLng location of the marker on the map. The position can be changed at any point if you want to move the marker.
The height above the map at which the marker is located, in meters. Elevation can be specified as either a height above terrain, or as an absolute altitude - see ElevationMode below.
Specifies how the Elevation property is interpreted, as either:
A height above the terrain (ground), in meters.
An absolute altitude (height above mean sea level), in meters.
Text to display alongside the marker icon.
A string identifier specifying the name of an icon to display. An empty value will result in no icon being displayed.
The draw order of the marker. Where markers would be drawn overlapping, marker with the lowest draw order is displayed, and the other overlapping markers temporarily hidden. If overlapping markers have equal draw order, then priority is based on screen position, with the marker that is lowest on screen being drawn. The default value is 0.
A String object associated with the marker. The API does not access this property - it is provided for developer convenience, to avoid storing an independent association. You could use this, for example, to store an ID from a data set.
Markers can be displayed on indoor maps. This property stores the string identifier of the indoor map on which the marker is to be displayed. For outdoor markers, this property is empty. The property cannot be changed after construction - a Marker must be created as either an outdoor marker (the default) or an indoor marker.
For a marker displayed on an indoor map, the identifier of the floor on which the marker is to be displayed.
Public methods in this class must be called on the Android UI thread.
Returns the position of the marker.
Returns: A LatLng object representing the location of the marker on the map’s surface.
void setPosition(LatLng position)
Sets the location of this marker.
|LatLng||position||A LatLng coordinate.|
Returns the current elevation of the marker. The property is interpreted differently, depending on the ElevationMode property.
Returns: A height, in meters.
void setElevation(double elevation)
Sets the elevation of this marker
|double||elevation||A height in meters. Interpretation depends on the current MarkerOptions.MarkerElevationMode|
Returns the mode specifying how the Elevation property is interpreted.
Returns: An enumerated value indicating whether Elevation is specified as a height above terrain, or an absolute altitude above sea level.
void setElevationMode(ElevationMode elevationMode)
Sets the elevation mode for this marker
|ElevationMode||elevationMode||The mode specifying how to interpret the Elevation property|
Gets the title of the marker
Returns: The marker’s title text.
void setTitle(String title)
Sets the title text to be displayed by this Marker
|String||title||The text to display. May be empty|
Gets the key of the icon to display on the marker.
Returns: A string key for the associated icon.
void setIconKey(String iconKey)
Sets the string key associated with the icon to be displayed by this Marker
Gets the draw order of the marker.
Returns: The marker’s draw order.
void setDrawOrder(int drawOrder)
Sets the draw order for this marker. Draw order is used to determine which marker to display when markers would otherwise overlap on the screen. The marker with the lowest drawOrder value takes precedence.
|int||drawOrder||Markers have a default drawOrder of 0.|
Gets the identifier of an indoor map on which this marker should be displayed, if any.
Returns: For a marker on an indoor map, the string identifier of the indoor map; otherwise an empty string.
Gets the identifier of an indoor map floor on which this marker should be displayed, if any.
Returns: For a marker on an indoor map, the identifier of the floor; otherwise 0.
Gets the user data associated with this marker.
Returns: The user data string.
Gets the style name used for this marker. Currently not
Returns: The style name used internally when binding a view for this marker