clusters library

Classes

BBox
Please make sure, you arrange your parameters like this: Longitude 1, Latitude 1, Altitude 1 (optional), Longitude 2, Latitude 2, Altitude 2 (optional) You can either specify 4 or 6 parameters If you are using the default constructor with two dimensional positions (lng + lat only), please use the constructor like this: BBox(lng1, lat1, lng2, lat2);
CoordinateType
Coordinate types, following https://tools.ietf.org/html/rfc7946#section-4
Feature<T extends GeometryObject>
Feature, as specified here https://tools.ietf.org/html/rfc7946#section-3.2
FeatureCollection<T extends GeometryObject>
FeatureCollection, as specified here https://tools.ietf.org/html/rfc7946#section-3.3
GeoJSONObject
GeometryCollection
GeometryCollection, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.8
GeometryObject
GeometryType<T>
LineString
LineString, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.4
MultiLineString
MultiLineString, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.5
MultiPoint
MultiPoint, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.3
MultiPolygon
MultiPolygon, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.7
Point
Point, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.2
Polygon
Polygon, as specified here https://tools.ietf.org/html/rfc7946#section-3.1.6
Position
Please make sure, you arrange your parameters like this:

Functions

applyFilter(Map? properties, dynamic filter) bool
applyFilter Takes a Map properties and a filter, Returns a bool indicating filter is applied to the properties.
clusterEach(FeatureCollection<GeometryObject> geojson, dynamic property, ClusterEachCallback callback) → void
clusterEach Takes a FeatureCollection, a dynamic property key/value used to create clusters, and a ClusterEachCallback method that takes (cluster, clusterValue, currentIndex) and Returns void. For example:
clusterReduce<T>(FeatureCollection<GeometryObject> geojson, dynamic property, ClusterReduceCallback<T> callback, dynamic initialValue) → T?
Reduces clusters in Features, similar to Iterable.reduce Takes a geojson, a dynamic porperty, a GeoJSONObject's property key/value used to create clusters, a ClusterReduceCallback method, and an initialValue to use as the first argument to the first call of the callback. Returns the value that results from the reduction. For example:
createBins(FeatureCollection<GeometryObject> geojson, dynamic property) Map<dynamic, List<int>>
createBins Takes a FeatureCollection geojson, and dynamic property key whose corresponding values of the Features will be used to create bins. Returns Map<String, List
filterProperties(Map<String, dynamic> properties, List<String>? keys) Map<String, dynamic>
filterProperties Takes Map<String, dynamic> properties, and List<String> keys used to filter Properties. Returns Map<String, dynamic> filtered Properties For example:
getCluster(FeatureCollection<GeometryObject> geojson, dynamic filter) FeatureCollection<GeometryObject>
Get Cluster Takes a FeatureCollection<Feature> and a dynamic filter used on GeoJSON properties to get Cluster. Returns a FeatureCollection single cluster filtered by GeoJSON Properties For example:
propertiesContainsFilter(Map properties, Map filter) bool
Properties contains filter (does not apply deepEqual operations) Takes a Map properties value, and a Map filter and Returns bool if filter does equal the properties For example

Typedefs

ClusterEachCallback = dynamic Function(FeatureCollection<GeometryObject>? cluster, dynamic clusterValue, int? currentIndex)
ClusterEachCallback Takes a FeatureCollection, the cluster being processed, a clusterValue used to create cluster being processed, and the currentIndex, the index of current element being processed in the List. Starts at index 0 Returns void.
ClusterReduceCallback<T> = T? Function(T? previousValue, FeatureCollection<GeometryObject>? cluster, dynamic clusterValue, int? currentIndex)
ClusterReduceCallback The first time the callback function is called, the values provided as arguments depend on whether the reduce method has an initialValue argument.