Class nokia.maps.clustering.MarkerTheme
Class Summary
An instance of this class represents each cluster and noise point on the map as a marker. It conforms to the interface nokia.maps.clustering.ITheme. Each cluster appears on the map as a circle showing a number indicating the size of the cluster. The color of the circle, its size and shadow depend on the size of the cluster. By contrast, noise points are presented as small blue dots, with white stroke color.
new nokia.maps.clustering.MarkerTheme
([position])
Method Summary
getClusterCoordinate
(data)
: nokia.maps.geo.ICoordinate
This method retrieves an object containing the geographic coordinates of the marker that represents a cluster.
getClusterPresentation
(data)
: nokia.maps.map.Marker
This method retrieves a marker representing a cluster.
static
getColor
(clusterSize)
: String
This method retrieves a color depending from the cluster size.
getNoisePresentation
(dataPoint)
: nokia.maps.map.StandardMarker
This method retrieves a standard marker representing a noise point.
Field Summary
static
String
POSITION_CENTER
This constant provides a value for nokia.maps.clustering.MarkerTheme.Options#position.
static
String
POSITION_FIRST
This constant provides a value for nokia.maps.clustering.MarkerTheme.Options#position.
static
String
POSITION_WEIGHT_CENTER
This constant provides a value for nokia.maps.clustering.MarkerTheme.Options#position.
Constructor Detail
This method creates an instance of MarkerTheme. It accepts configuration
settings as an argument.
new nokia.maps.clustering.MarkerTheme([position])
Parameters:
| {String} | [position] | A value indicating the position of the cluster presenter marker; it should be one of the static variables POSITION_CENTER, POSITION_FIRST and POSITION_WEIGHT_CENTER defined in this class; if the method receives an unsupported position identifier, it uses POSITION_WEIGHT_CENTER by default |
Method Detail
getClusterCoordinate
(data)
: nokia.maps.geo.ICoordinate
This method retrieves an object containing the geographic coordinates
of the marker that represents a cluster.
Parameters:
| {nokia.maps.clustering.IClusterPoint[] | nokia.maps.clustering.Cluster} | data | A collection of objects representing data points (contain latitude and longitude) or an instance of nokia.maps.clustering.Cluster; in addition, each point may contain a "value" attribute if you wish to position the cluster marker according to the "weight" center of the cluster (see also nokia.maps.clustering.IClusterPoint) |
Returns:
| {nokia.maps.geo.ICoordinate} | An object containing the geographic coordinates of the position of cluster marker |
getClusterPresentation
(data)
: nokia.maps.map.Marker
This method retrieves a marker representing a cluster.
Parameters:
| {nokia.maps.clustering.IClusterPoint[] | nokia.maps.clustering.Cluster} | data | A collection of objects representing data points (contain latitude and longitude) or an instance of nokia.maps.clustering.Cluster; in addition, each point may contain a "value" attribute if you wish to position the cluster marker according to the "weight" center of the cluster (see also nokia.maps.clustering.IClusterPoint) |
Returns:
| {nokia.maps.map.Marker} | An instance of nokia.maps.map.StandardMarker showing a numeric value indicating the number of elements inside the cluster. The color of the marker also depends on the size of the cluster |
static
getColor
(clusterSize)
: String
This method retrieves a color depending from the cluster size.
- #76D100 - if cluster size is smaller than 10
- #FF6900 - if cluster size is bigger than 10, but less than 25
- #F03C00 - if cluster size is bigger than 25, but less than 50
- #B50015 - if cluster size is bigger than 100
Parameters:
| {Number} | clusterSize | A value indicating the size of the cluster |
Returns:
| {String} | An RGB string, for example #RRGGBB |
getNoisePresentation
(dataPoint)
: nokia.maps.map.StandardMarker
This method retrieves a standard marker representing a noise point.
Parameters:
| {nokia.maps.clustering.IClusterPoint} | dataPoint | An object representing a noise point, containing latitude, longitude and optionally weight |
Returns:
| {nokia.maps.map.StandardMarker} | A standard marker positioned at the location supplied by the argument |
Field Detail
static
String
POSITION_CENTER
This constant provides a value for nokia.maps.clustering.MarkerTheme.Options#position.
It ensures that the cluster marker is drawn in the center of the
minimum rectangle containing all data points in the cluster.
