Hooks
Hooks are configurable actions
to perform when a given scenario/event takes place. For example, when a feature is saved, you may want to trigger a web hook (HTTP POST request) to perform some type of activity on a 3rd party system or application..
The following example would trigger a web hook
event when a feature is saved.
{
hooks: {
type: 'feature-edits-applied',
actions: [
{
type: 'webhook',
url: 'https://some-service.rizing.com/RefreshData?featureId={id}'
}
]
}
}
General Post Message Hooks
The application will automatically trigger several postMessage events for common actions/scenarios - without the need to specifically register a hook. The following is a list of Post Message events that will be fired with their corresponding event:
Event Name | Event Scenario | Payload |
---|---|---|
feature-edits-applied | Fired when a feature edit is made (add, update, or delete) | JSON object with all adds, updates, and deletes |
feature-edits-applied
The feature-edits-applied
event is fired whenever an edit (or multiple edits) are applied to a layer - this includes; adds, updates, and deletes. An example event payload object is as follows:
{
eventName: 'feature-edits-applied',
data:{
layer: { id: 'my-layer' }, // <-- updated layer ID
adds: [
{
attributes: {
id: 123,
name: 'Harrisburg'
},
geometry: { x: -72, y: 42 }
}
],
updates: [],
deletes: []
}
}
Post Message Hooks
Coming soon...
Webhooks
Coming soon...
Links
Coming soon...