Skip to main content

LAND IT Front-end Extensions SDK

This API can be used by the front-end modules of an extension (Custom UI modules) to interact with the LAND IT front-end application and retrieve data such as context data (current scenario and version where the module is being executed/displayed), available layers and geometries.

These methods are async (return Promises), since the postMessage() method is used for communication between the extension IFrame and the main application.


getProps()

Get context "props" for the extension component (scenarioId and versionId)

Example response
{
"scenarioId": 1,
"versionId": 2
}

getLayers()

Get information about the existing layers on the current scenario version.

Example response
[
{
"name": "POSP",
"description": "...",
"scenarioId": 1,
"versionId": 2,
"id": 21,
"visible": true,
"selected": 0,
"type": "ScenarioPOSP",
"geometryType": "POLYGONS",
"renderer": {...}
},
{
...
}
]

getLayersOfType(layerType: string)

Get information about the layers of a specific type on the current scenario version.

  • Parameters:
    • layerType — type of layer. Examples: "ScenarioPOSP", "ScenarioIS", "ScenarioES", "POSA", "Edit"
Example response

layerType = "ScenarioPOSP"

[
{
"name": "POSP",
"description": "...",
"scenarioId": 1,
"versionId": 2,
"id": 21,
"visible": true,
"selected": 0,
"type": "ScenarioPOSP",
"geometryType": "POLYGONS",
"renderer": {...}
}
]

getLayersGeometries()

Get geometries of all layers on the current scenario version.

Example response
[
{
"layer": 21,
"geoms": [
{
"id": 1000,
"geojson": "...",
"geomType": "POLYGONS",
"area": 731.8,
"perimeter": 195.8,
"attributes": [...]
},
...
]
},
{
...
}
]

getGeometriesByLayer(layerType: string)

Get geometries of layers of a specific type on the current scenario version.

  • Parameters:
    • layerType — type of layer. Examples: "ScenarioPOSP", "ScenarioIS", "ScenarioES", "POSA", "Edit"
Example response

layerType = "ScenarioPOSP"

[
[
{
"id": 1000,
"geojson": "...",
"geomType": "POLYGONS",
"area": 731.8,
"perimeter": 195.8,
"attributes": [...]
},
...
]
]

executeFunctionModule(extension: string, module: string, input: any, fileOutput: boolean = false)

Execute an extension function module (in the back-end) and retrieve its result.

  • Parameters:
    • extension — id of the extension
    • module — id of the module to execute
    • input — input to pass to the function module
    • fileOutput — true if the module returns a (binary) file, false if it returns json