public class MultiMarker extends java.lang.Object implements Marker
Modifier and Type | Field and Description |
---|---|
protected boolean |
hidden |
protected java.lang.String |
id |
protected java.util.List<Marker> |
markers |
java.util.HashMap<java.lang.String,java.lang.Object> |
properties |
protected boolean |
selected |
Constructor and Description |
---|
MultiMarker() |
Modifier and Type | Method and Description |
---|---|
void |
addMarkers(Marker... markers) |
void |
draw(UnfoldingMap map)
Draws this marker.
|
double |
getDistanceTo(Location location)
return distance between location and the (to the location) closest marker
|
java.lang.String |
getId()
Gets the marker ID.
|
java.lang.Integer |
getIntegerProperty(java.lang.String key)
Gets the property as Integer for given key.
|
Location |
getLocation()
Return center of all markers.
|
java.util.List<Marker> |
getMarkers() |
java.util.HashMap<java.lang.String,java.lang.Object> |
getProperties()
Gets the optional properties of this marker.
|
java.lang.Object |
getProperty(java.lang.String key)
Gets the property for given key.
|
java.lang.String |
getStringProperty(java.lang.String key)
Gets the property as String for given key.
|
boolean |
isHidden()
Indicates whether this marker is hidden.
|
boolean |
isInside(UnfoldingMap map,
float checkX,
float checkY)
Returns true if at least one marker is hit.
|
boolean |
isInsideByLocation(float latitude,
float longitude)
Returns true if at least one marker is hit.
|
boolean |
isSelected()
Indicates whether this multi marker is selected.
|
void |
setColor(int color)
Sets the main color of this marker.
|
void |
setHidden(boolean hidden)
Sets the visibility status of this marker.
|
void |
setHighlightColor(int color)
Sets the highlight color of this marker.
|
void |
setHighlightStrokeColor(int color)
Sets the highlight color of this marker's border.
|
void |
setId(java.lang.String id)
Sets the marker ID.
|
void |
setLocation(float lat,
float lng)
Set the location for this marker.
|
void |
setLocation(Location location)
Set the location for this marker.
|
void |
setMarkers(java.util.List<Marker> markers) |
void |
setProperties(java.util.HashMap<java.lang.String,java.lang.Object> properties)
Sets the optional properties of this marker.
|
java.lang.Object |
setProperty(java.lang.String key,
java.lang.Object value)
Sets the property for given key.
|
void |
setSelected(boolean selected)
Sets the selected status of all its markers.
|
void |
setStrokeColor(int color)
Sets the color of this marker's border.
|
void |
setStrokeWeight(int weight)
Sets the thickness of the border of this marker.
|
protected java.util.List<Marker> markers
public java.util.HashMap<java.lang.String,java.lang.Object> properties
protected boolean selected
protected boolean hidden
protected java.lang.String id
public java.lang.String getId()
Marker
public void setId(java.lang.String id)
Marker
public void setMarkers(java.util.List<Marker> markers)
public java.util.List<Marker> getMarkers()
public void addMarkers(Marker... markers)
public Location getLocation()
GeoUtils.getCentroid(List)
instead.getLocation
in interface Marker
public void setLocation(float lat, float lng)
Marker
setLocation
in interface Marker
lat
- latitudelng
- longitudepublic void setLocation(Location location)
Marker
setLocation
in interface Marker
location
- Location with lat, lngpublic double getDistanceTo(Location location)
getDistanceTo
in interface Marker
location
- The location to calculate the distance to.public void setProperties(java.util.HashMap<java.lang.String,java.lang.Object> properties)
Marker
setProperties
in interface Marker
properties
- The properties to set. The map consist of key,value pairs for each property.public java.lang.Object setProperty(java.lang.String key, java.lang.Object value)
Marker
setProperty
in interface Marker
key
- The key of the property.value
- The value of the property.public java.util.HashMap<java.lang.String,java.lang.Object> getProperties()
Marker
getProperties
in interface Marker
public java.lang.Object getProperty(java.lang.String key)
Marker
getProperty
in interface Marker
key
- The key of the property.public java.lang.String getStringProperty(java.lang.String key)
Marker
getStringProperty
in interface Marker
key
- The key of the property.public java.lang.Integer getIntegerProperty(java.lang.String key)
Marker
getIntegerProperty
in interface Marker
key
- The key of the property.public boolean isInside(UnfoldingMap map, float checkX, float checkY)
public boolean isInsideByLocation(float latitude, float longitude)
AbstractShapeMarker.isInsideByLocation(float, float)
.public void draw(UnfoldingMap map)
Marker
public void setSelected(boolean selected)
setSelected
in interface Marker
selected
- Whether this marker is selected or not.public boolean isSelected()
isSelected
in interface Marker
public void setHidden(boolean hidden)
Marker
public boolean isHidden()
Marker
public void setColor(int color)
Marker
public void setStrokeColor(int color)
Marker
setStrokeColor
in interface Marker
color
- The color (in Processing's color type)public void setStrokeWeight(int weight)
Marker
setStrokeWeight
in interface Marker
weight
- Thickness in pixel.public void setHighlightColor(int color)
Marker
setHighlightColor
in interface Marker
color
- The color (in Processing's color type)public void setHighlightStrokeColor(int color)
Marker
setHighlightStrokeColor
in interface Marker