Creates an action trigger. Action triggers are rendered on map's left sidebar as a button, similar to other map extensions like measure and spatial filter.
The goal of action triggers is to allow users to perform actions on the map by clicking on a button.
Properties provided will override the existing properties.
Example
deleteFeatureAction()
deleteFeatureAction(id: string): void
Deletes a feature contextual action.
Parameters
Parameter
Type
Description
id
string
The id of the feature contextual action to delete.
Returns
void
Example
createPanelId()
createPanelId(): Promise<string>
Creates a panel ID.
In order to create a panel using createOrUpdatePanel, you need to create a panel ID first. Panel IDs are automatically generated to prevent conflicts with other panels.
Panels are rendered on the map's right sidebar and allow you to extend Felt UI for your own use cases using Felt UI elements (e.g., Text, Button, etc.).
A panel is identified by its ID, which must be created using createPanelId. Custom IDs are not supported to prevent conflicts with other panels.
Panels have two main sections:
body - The main content area of the panel, which is scrollable.
footer - A section that sticks to the bottom of the panel, useful for action buttons like "Submit" or "Cancel".
Panel placement is controlled by the initialPlacement parameter. By default, panels are added to the end of the panel stack, but you can specify a different placement. Note that this placement cannot be changed after the panel is created.
Element IDs are required for targeted updates and deletions using the other panel management methods. For complete panel refreshes with this method, element IDs are optional but recommended for consistency.
For dynamic content management, consider these approaches:
Use this method for complete panel refreshes (replaces all content)
Updates an existing element in a panel. This method can only update elements that already exist in the panel and have an ID.
Use this method to modify specific elements without replacing the entire panel. This is more efficient than using createOrUpdatePanel for small changes.
Control the on-map UI shown when interacting with features and elements.
If you add your own click, selection or hover handlers you may want to disable various parts of the Felt UI. This method allows you to control the visibility of various parts of the UI that might otherwise be shown when people click or hover on things.
This does not affect selection. That means that selectable features and elements will still be selected when clicked.
Shows a data table view for the specified layer, optionally sorted by a given attribute.
The data table displays feature data in a tabular format, making it easy to browse and analyze layer data. You can control the initial sorting of the table.
// Show some UI controls
await felt.updateUiControls({
showLegend: true,
fullScreenButton: true,
});
// Disable some UI options
await felt.updateUiControls({
cooperativeGestures: false,
geolocation: false,
});
// Disable UI when hovering or selecting features
await felt.setOnMapInteractionsUi({
featureSelectPanel: false,
featureHoverPanel: false,
});
// Show data table with default sorting
await felt.showLayerDataTable({
layerId: "layer-1",
});
// Show data table sorted by height in descending order
await felt.showLayerDataTable({
layerId: "layer-1",
sorting: {
attribute: "height",
direction: "desc",
},
});
// Show the data table pane with no table visible
await felt.showLayerDataTable();