Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
FilterLogicGate:
"and"
|"or"
Layers in a Felt map hold geospatial data, but also configure how the data is rendered both on the map and in the legend. The data can be vector data such as Points, Lines, or Polygons, or raster data such as satellite images.
Each Layer can be grouped under a LayerGroup, and has associated LegendItems that represent how the layer is rendered in the legend.
You can control the visibility of layers, layer groups, and legend items using the setLayerVisibility
, setLayerGroupVisibility
, and setLegendItemVisibility
methods.
When a Layer is styled to as categorical data or "classed" numeric data, there will be a LegendItem for each category or class. Each LegendItem can be controlled for visibility independently of the Layer, so you can turn on and off each category or class individually.
A feature is a single geographical item in a layer. The unique ID for a feature is a compound key made up of the layer ID and the feature ID.
id:
string
|number
The identifier of the feature, unique within the layer.
layerId:
string
The identifier of the layer that the feature belongs to.
geometryType:
"Point"
|"Polygon"
|"MultiPolygon"
|"LineString"
|string
& {}
The type of geometry of the feature.
properties:
Record
<string
,unknown
>
The properties of the feature, as a bag of attributes.
FilterTernary: [
FilterTernary
|FilterExpression
|null
|boolean
,FilterLogicGate
,FilterTernary
|FilterExpression
|null
|boolean
]
Filters:
FilterTernary
|FilterExpression
|null
|boolean
Filters can be used to change which features in a layer are rendered. Filters can be applied to a layer by the setLayerFilters
method on the Felt controller.
The possible operators are:
lt
: Less than
gt
: Greater than
le
: Less than or equal to
ge
: Greater than or equal to
eq
: Equal to
ne
: Not equal to
cn
: Contains
nc
: Does not contain
The allowed boolean operators are:
and
: Logical AND
or
: Logical OR
The parameters for the onLayerChange
listener.
layer:
null
|Layer
The new data for the layer or null if the layer was removed.
LayerProcessingStatus:
"processing"
|"completed"
|"failed"
|"incomplete"
This describes the processing status of a layer.
The various values are:
processing
: The layer has been uploaded or updated and is still processing.
completed
: The layer has been processed and can be viewed on the map.
failed
: The layer failed to process and cannot be viewed on the map.
incomplete
: The layer has not been processed.
FilterExpression: [
null
|string
,"in"
|"ni"
,null
| (null
|string
|number
|boolean
)[]] | [null
|string
,"lt"
|"gt"
|"le"
|"ge"
|"eq"
|"ne"
|"cn"
|"nc"
|"is"
|"isnt"
,null
|string
|number
|boolean
]
id:
string
The string identifying the layer
groupId:
null
|string
The ID of the layer group that the layer belongs to.
Layers that appear at the root level in Felt will not have a group ID.
name:
string
The name of the layer can be displayed in the Legend, depending on how the layer's legend is configured in its style.
caption:
null
|string
The layer's caption is shown in the legend.
description:
null
|string
The layer description forms part of the layer's metadata. This is visible to users via the layer info button in the legend.
visible:
boolean
Whether the layer is visible or not.
shownInLegend:
boolean
Whether the layer is shown in the legend or not.
status:
"processing"
|"completed"
|"failed"
|"incomplete"
The current processing status of the layer.
geometryType:
null
|string
The geometry type of the layer.
Remarks
This will generally be one of:
"Point"
"Line"
"Polygon"
"Raster"
null
When the layer is processing, or it is a data-only layer, it will be null. You should expect this to be able to be any string, however, as more geometry types can be added in the future.
bounds:
null
| [number
,number
,number
,number
]
The bounding box of the layer. If the layer is processing, or the bounds have otherwise not been calculated or are not available, this will be null
.
id:
string
A string identifying the layer group.
name:
string
The name of the layer group. This is shown in the legend.
caption:
null
|string
The caption of the layer group. This is shown in the legend.
layerIds:
string
[]
The ids of the layers in the layer group.
Remarks
You can use these ids to get the full layer objects via the getLayers
method.
visible:
boolean
Whether the layer group is visible or not.
shownInLegend:
boolean
Whether the layer group is shown in the legend or not.
bounds:
null
| [number
,number
,number
,number
]
The bounding box of the layer group.
The filters that are currently set on a layer.
A layer's filters are the combination of various different places in which filters can be applied.
style:
Filters that are set in the layer's style. These are the lowest level of filters, and can only be set by editing the map.
components:
Filters that are set in the layer's components, which are interactive elements in the legend. These can be set by viewers for their own session, but their default value can be set by the map creator.
ephemeral:
Filters that are set ephemerally by viewers in their own session.
These are the filters that are set when the setLayerFilters
method is called. There is no way to set these in the Felt UI - they can only be set using the SDK.
The combined result of all the filters set on the layer.
The Layers controller allows you to get information about the layers on the map, and make changes to their visibility.
Layers can be organised into groups, and their groups can also have their visibility toggled.
getLayer(
id
:string
):Promise
<null
| >
Get a single layer from the map by its id.
Parameters
Parameter | Type | Description |
---|
Returns
Promise
<null
| >
The requested layer.
Example
Gets layers from the map, according to the constraints supplied. If no constraints are supplied, all layers will be returned.
Parameters
Returns
All layers on the map.
Remarks
The layers in the map, ordered by the order specified in Felt. This is not necessarily the order that they are drawn in, as Felt draws points above lines and lines above polygons, for instance.
Example
Hide or show layers with the given ids.
Parameters
Returns
Promise
<void
>
Example
Get a layer group from the map by its id.
Parameters
Returns
The requested layer group.
Example
Gets layer groups from the map, according to the constraints supplied. If no constraints are supplied, all layer groups will be returned in rendering order.
Parameters
Returns
The requested layer groups.
Example
Hide or show layer groups with the given ids.
Parameters
Returns
Promise
<void
>
Example
Allows you to get the state of a single legend item.
Parameters
Returns
Example
Allows you to obtain the state of several legend items, by passing in constraints describing which legend items you want.
If you do not pass any constraints, you will receive all legend items.
Parameters
Returns
Example
Hide or show legend items with the given identifiers.
Parameters
Returns
Promise
<void
>
Example
Get the filters for a layer.
Parameters
Returns
Remarks
The return type gives you the filters split up into the various sources that make up the overall filters for a layer.
Example
Sets the ephemeral filters for a layer.
Parameters
Returns
Promise
<void
>
Example
Get the features that are currently rendered on the map in the viewport.
Note that this is explicitly about the features that are rendered, which isn't necessarily a complete list of all the features in the viewport. This is because of the way features are tiled: at low zoom levels or high feature densities, many features are omitted from what is rendered on the screen.
Parameters
Returns
Example
Adds a listener for when a layer changes.
Parameters
Returns
VoidFunction
A function to unsubscribe from the listener
Example
Adds a listener for when a layer group changes.
Parameters
Returns
VoidFunction
A function to unsubscribe from the listener
Example
Adds a listener for when a legend item changes.
Parameters
Returns
VoidFunction
A function to unsubscribe from the listener
Example
combined:
getLayers(constraint
?: ): Promise
<(null
| )[]>
Parameter | Type | Description |
---|
Promise
<(null
| )[]>
setLayerVisibility(visibility
: ): Promise
<void
>
Parameter | Type |
---|
getLayerGroup(id
: string
): Promise
<null
| >
Parameter | Type |
---|
Promise
<null
| >
getLayerGroups(constraint
?: ): Promise
<(null
| )[]>
Parameter | Type | Description |
---|
Promise
<(null
| )[]>
setLayerGroupVisibility(visibility
: ): Promise
<void
>
Parameter | Type |
---|
getLegendItem(id
: ): Promise
<null
| >
Parameter | Type |
---|
Promise
<null
| >
getLegendItems(constraint
?: ): Promise
<(null
| )[]>
Parameter | Type |
---|
Promise
<(null
| )[]>
setLegendItemVisibility(visibility
: {show
: [];hide
: []; }): Promise
<void
>
Parameter | Type |
---|
getLayerFilters(layerId
: string
): Promise
<null
| >
Parameter | Type |
---|
Promise
<null
| >
setLayerFilters(params
: {layerId
: string
;filters
: ; }): Promise
<void
>
Parameter | Type | Description |
---|
getRenderedFeatures(params
?: ): Promise
<[]>
Parameter | Type | Description |
---|
Promise
<[]>
onLayerChange(args
: {options
: {id
: string
; };handler
: (change
: ) => void
; }): VoidFunction
Parameter | Type | Description |
---|
onLayerGroupChange(args
: {options
: {id
: string
; };handler
: (change
: ) => void
; }): VoidFunction
Parameter | Type |
---|
onLegendItemChange(args
: {options
: ;handler
: (change
: ) => void
; }): VoidFunction
Parameter | Type |
---|
|
|
|
|
|
| The id of the layer you want to get. |
The parameters for the onLegendItemChange
listener.
legendItem:
null
|LegendItem
The new data for the legend item or null if the legend item was removed.
A legend item, which often represents a sub-class of features in a layer in the case of categorical or classed layers.
title:
string
|string
[]
The title of the legend item.
titleDependsOnZoom:
boolean
Whether the title depends on the zoom level or not. If it does, you need to call getLegendItem
when the zoom level changes.
Note that as the zoom level changes, the onLegendItemChange
handler will not be called, so you need to call getLegendItem
yourself.
visible:
boolean
Whether the legend item is visible or not.
id:
string
The id of the legend item.
layerId:
string
The id of the layer the legend item belongs to.
A raster pixel value for a specific layer.
value:
number
The value of the pixel.
layerId:
string
The ID of the layer that the pixel belongs to.
categoryName:
null
|string
The name of the category that the pixel belongs to.
color:
null
| {r
:number
;g
:number
;b
:number
;a
:number
; }
The color of the pixel. Each value is between 0 and 255.
| The constraints to apply to the layers returned from the map. |
|
| The constraints to apply to the layer groups returned from the map. |
|
|
|
|
|
|
|
|
| - |
|
| The layer that you want to set the filters for. |
| The filters to set for the layer. This will replace any ephemeral filters that are currently set for the layer. |
| The constraints to apply to the features returned from the map. |
|
| - |
|
| - |
|
| The id of the layer to listen for changes to. |
| The handler that is called when the layer changes. |
|
|
|
|
|
|
|
|
|
|
|
[]
[]
(change
: ) => void
(change
: ) => void
(change
: ) => void