/ui/utils/locationCount
Exports the default locationCount utility method as mapp.ui.utils.locationCount().
- Source
Methods
(inner) locationCount(layer) → {Integer}
Returns the length of the layer.Features[] array or the response from a layer_count query.
The layer.Features[] array length is returned if the filter is not restricted to the viewport, or if the layer features have been loaded for the viewport. Cluster layer features are not counted as locations.
The layer.loading promise must resolve before the layer.Features[] array can be counted. The previous layer.Features[] would otherwise be counted while the request for the current filter is still pending. The layer.loading promise is assigned by the vector layer reload method before the request is debounced, and resolves once the features of the latest request have been set. The location_count query does not wait for the layer data to load.
| Name | Type | Description |
|---|---|---|
layer | layer |
| Name | Type | Attributes | Description |
|---|---|---|---|
layer.loading | Promise | <optional> | Resolves once the features of the latest layer data request have been set. |
layer.key | String | The layers' identifier. | |
layer.format | String | The layer format. | |
layer.filter | Object | The filter currently active on the layer. | |
layer.params | Object | <optional> | The parameters for the layer data query. |
layer.mapview | Object | The mapview associated to the layer. | |
layer.queryparams | Object | <optional> | The query parameters that are being used on the layer. |
- Source
The number of locations that pass the filter.
- Type:
- Integer