MarkerCollection
Summary
A collection of Marker objects.
By default, marker collections are rendered using a clustering strategy (eg MarkerClustererPlus for google maps).
A MarkerCollection is a type of ViewCollection, which means that it can bind its attributes to a data collection (Collection or Backbone.Collection). Any changes, additions, or deletions to the bound data collection will be reflected in the marker collection.
See Marker documentation for more information on transforming raw data into marker attributes. Note that attributeTransforms
can be set directly on the MarkerCollection object using the modelOptions
option:
var markers = new aeris.maps.markercollections.MarkerCollection(null, {
modelOptions: {
attributeTransforms: {
// ...
}
}
});
Constructor
aeris.maps.markercollections.MarkerCollection
Syntax
aeris.maps.markercollections.MarkerCollection
-
opt_markers
-
opt_options
Summary
Parameters:
-
opt_markers
Array.<Marker>=Markers to add to the collection.
-
opt_options
Object=-
model
Function=Constructor for an {aeris.maps.markers.Marker} object. to use as a model for the collection.
-
clusterStrategy
function():AbstractStrategy=Strategy for rendering marker clusters.
-
clusterStyles
ClusterStyles= -
clusterOptions
Object=Options to pass onto the marker clusterer view.
-
cluster
Boolean=Whether to cluster markers. Default is true.
-
strategy
string|AbstractStrategy=
-
Item Index
Methods
Properties
Methods
_onModelEvent
Syntax
_onModelEvent
()
Summary
From Backbone.Collection#_onModelEvent
createStrategy_
Syntax
Summary
Create a {aeris.maps.AbstractStrategy} instance.
Override to adjust how strategy objects are instantiated.
Parameters:
-
Strategy
FunctionAbstractStrategy object ctor.
Returns:
getClusterStyle
Syntax
Summary
Returns a copy of the cluster styles for the specified cluster group.
Parameters:
-
opt_group
String=Defaults to 'defaultStyles.'.
Returns:
Cluster styles object.
getMap
Syntax
getMap
()
Summary
removeStrategy
Syntax
removeStrategy
()
Summary
Remove and clean up the StrategyObject's strategy.
resetStrategy
Syntax
resetStrategy
()
Summary
Reset the rendering strategy used by the object. Useful for re-enabled a strategy which has previously been removed with StrategyObject#removeStrategy
setMap
Syntax
setMap
()
Summary
Set the map on all child MapObjects.
Any newly created map objects will be instantiated with the map set here.
setStrategy
Syntax
setStrategy
-
Strategy
Summary
Set the strategy to use for rendering the StrategyObject.
Parameters:
-
Strategy
FunctionConstructor for an {aeris.maps.AbstractStrategy} object.
startClustering
Syntax
startClustering
()
Summary
Starts up the strategy defined by this.clusterStrategy_.
stopClustering
Syntax
stopClustering
()
Summary
Destroys the clustering strategy started up by #startClustering.
Properties
clusterStrategy_
Syntax
clusterStrategy_
function():aeris.maps.AbstractStrategy
private
Summary
clusterStyles_
Syntax
Summary
isClustering_
Syntax
Summary
Whether a clustering strategy is currently active.
map_
Syntax
map_
?aeris.maps.Map
private
Summary
strategy_
Syntax
strategy_
?aeris.maps.AbstractStrategy
protected
Summary
The strategy used to interact with the map view.
StrategyType_
Syntax
StrategyType_
function():aeris.maps.AbstractStrategy
private
Summary
Events
cluster:mouseout
Syntax
cluster:mouseout
Summary
When the mouse exits a cluster.
Event Payload:
-
latLon
aeris.maps.LatLon
cluster:mouseout
Syntax
cluster:mouseout
Summary
When the mouse exits a cluster.
Event Payload:
-
latLon
aeris.maps.LatLon
cluster:mouseover
Syntax
cluster:mouseover
Summary
When the mouse enters a cluster.
Event Payload:
-
latLon
aeris.maps.LatLon
cluster:mouseover
Syntax
cluster:mouseover
Summary
When the mouse enters a cluster.
Event Payload:
-
latLon
aeris.maps.LatLon
strategy:set
Syntax
strategy:set
Summary
When a strategy is set on the object.
Event Payload:
-
strategy
aeris.maps.AbstractStrategy