/layer/featureFormats
The featureFormats module exports utility methods to process the response data from layer queries into Openlayers features.
- Source
Methods
(inner) cluster(layer, features) → {Array}
The cluster function processes an array of feature data and returns an array of OpenLayers features to be added to the layer source.
It creates Point geometries from coordinate pairs, extracts count and ID information, and assigns additional properties based on the layer's field definitions.
The function also tracks the maximum count across all features in the layer.max_size property.
Name | Type | Description |
---|---|---|
layer | layer | A layer object, likely an OpenLayers layer. |
features | Array | An array of feature data, where each feature is represented as an array. |
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
layer.max_size | number | The maximum count across all features. | ||||||
layer.params | Object | Properties
|
- Source
Array of OpenLayers Feature objects.
- Type:
- Array
(inner) geojson(layer, features) → {array}
The geojson featureFormats method processes an array of wkt features and returns Openlayers features to be added to the layer source.
The geometry of the features will be projected from the layer.srid data projection to the layer.mapview.srid projection for display in the mapview.Map.
The layer.params.fields[] property values will be added to the layer.featureFields field values arrays to be processed by the featureFields.process() method.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer object. |
features | array | An array of WKT features. |
Name | Type | Description |
---|---|---|
layer.srid | string | Feature data projection. |
layer.params | Object | |
params.fields | Array | Array of field names for feature properties. |
- Source
Array of Openlayers features.
- Type:
- array
(inner) wkt(layer, features) → {array}
The wkt featureFormats method processes an array of wkt features and returns Openlayers features to be added to the layer source.
The geometry of the features will be projected from the layer.srid data projection to the layer.mapview.srid projection for display in the mapview.Map.
The layer.params.fields[] property values will be added to the layer.featureFields field values arrays to be processed by the featureFields.process() method.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer object. |
features | array | An array of WKT features. |
Name | Type | Description |
---|---|---|
layer.srid | string | Feature data projection. |
layer.params | Object | |
params.fields | Array | Array of field names for feature properties. |
- Source
Array of Openlayers features.
- Type:
- array
(inner) wkt_properties(layer, features)
In order to process featureFields for tiled datasets it is required to request the feature properties separate from the vector tile geometries.
The property features do not have a geometry property and the wkt_properties method does not return an array of Openlayers features.
The feature properties are assigned to the layer.featuresObject{} with the feature ID as property key for lookup of the properties in the featureStyle method.
The layer.params.fields[] property values will be added to the layer.featureFields field values arrays to be processed by the featureFields.process() method.
Name | Type | Description |
---|---|---|
layer | layer | A decorated mapp layer object. |
features | array | An array of WKT features. |
Name | Type | Description |
---|---|---|
layer.featuresObject | Object | Store feature properties with the feature ID as property key for lookup in the featureStyle method. |
layer.params | Object | |
params.fields | Array | Array of field names for feature properties. |
- Source