Class: BinBase

ol.source. BinBase


new BinBase(options)

Abstract base class; normally only used for creating subclasses. Bin collector for data

Parameters:
Name Type Description
options Object

ol.source.VectorOptions + grid option

Properties
Name Type Argument Description
source ol.source.Vector

Source

listenChange boolean

listen changes (move) on source features to recalculate the bin, default true

geometryFunction fucntion <optional>

Function that takes an ol.Feature as argument and returns an ol.geom.Point as feature's center.

flatAttributes function <optional>

Function takes a bin and the features it contains and aggragate the features in the bin attributes when saving

Extends

Methods


_flatAttributes(bin, features)

Create bin attributes using the features it contains when exporting

Parameters:
Name Type Description
bin ol.Feature

the bin to export

features Array.<ol.Features>

the features it contains


clear()

Overwrite ol/source/Vector clear to fire clearstart / clearend event

Inherited From:

getBin(f)

Get the bin that contains a feature

Parameters:
Name Type Description
f ol.Feature

the feature

Returns:

the bin or null it doesn't exit

Type
ol.Feature

getBinAt(coord, create)

Get the bean at a coord

Parameters:
Name Type Description
coord ol.Coordinate
create boolean

true to create if doesn't exit

Returns:

the bin or null it doesn't exit

Type
ol.Feature

getGridFeatures()

Get features without circular dependencies (vs. getFeatures)

Returns:
Type
Array.<ol.Feature>

getGridGeomAt(coord, attributes)

Get the grid geometry at the coord

Parameters:
Name Type Description
coord ol.Coordinate
attributes Object

add key/value to this object to add properties to the grid feature

Returns:
Type
ol.geom.Polygon

getSource()

Get the orginal source

Returns:
Type
ol.source.Vector

reset()

Clear all bins and generate a new one.