mapp.layer.formats.vector()
This module defines the vector format for map layers.
- Source
Methods
(inner) clusterConfig(layer)
Configures the clustering options for a layer.
Name | Type | Description |
---|---|---|
layer | Object | The layer object. |
Name | Type | Attributes | Description |
---|---|---|---|
layer.key | string | The key of the layer. | |
layer.srid | string | The spatial reference system identifier (SRID) for the layer. | |
layer.params | Object | Parameter for data request. | |
layer.cluster | Object | The clustering configuration for the layer. | |
cluster.distance | number | <optional> | The distance threshold for clustering. |
cluster.resolution | number | <optional> | The resolution threshold for clustering. |
cluster.hexgrid | boolean | <optional> | Flag indicating whether to use hexgrid clustering. |
- Source
(inner) clusterSourceChange(layer)
The clusterSourceChange event method is called by changes to the cluster source. The method will map all features in cluster source to return an array of features [counts] for each feature in the cluster source. The largest features count from the array will be assigned as the cluster.max_size.
Name | Type | Description |
---|---|---|
layer | layer | The Mapp layer object. |
Name | Type | Description |
---|---|---|
layer.cluster | layer-cluster | The vector layer cluster configuration. |
cluster.max_size | integer | The length of features in the largest cluster feature. |
- Source
(inner) reload(callbackopt)
The layer.reload() method determines the table and geometry for the current zoom level. And uses the layer.params{} to create a request for layer features to be added to the layer source.
The xhr request is debounced by 100ms to prevent requests in quick succession on panning, scroll, and touch zooming.
The reload method is bound to the layer object and doesn't require any arguments.
Finally the optional callback function param will be executed if provided.
Name | Type | Attributes | Description |
---|---|---|---|
callback | function | <optional> | Optional callback function. |
Name | Type | Description |
---|---|---|
layer.params | Object | Parameter for data request. |
layer.timeout | Object | Timeout for the xhr request. |
- Source
(inner) vector(layer)
Creates Openlayers layer and source for vector format mapp layer.
Name | Type | Description |
---|---|---|
layer | layer | The Mapp layer object. |
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
layer.srid | string | <optional> | The spatial reference system identifier (SRID) for the layer. | |
layer.params | Object | <optional> | {} | Parameters for the layer data query. |
layer.setSource | function | Method pass features to layer source. | ||
layer.reload | function | Method to reload layer data. | ||
layer.features | Array | <optional> | An array of features for the layer. | |
layer.fade | boolean | <optional> | Flag indicating whether to apply a fade effect to the layer. | |
layer.cluster | layer-cluster | <optional> | Point layer cluster configuration. | |
layer.source | Object | <optional> | OpenLayers vector source. | |
layer.style | layer-style | The mapp-layer style configuration. | ||
layer.zIndex | number | <optional> | The zIndex for the layer canvas element. |
- Source