• JMap.Form.openUpdateDialogForLayer

    Opens the form update dialog.

    Parameters

    • layerId: JId

      the JMap layer id

    • elements: JFormElement[]

      the elements to update

    Returns Promise<JFormMetaData[]>

    Throws

    if layer not found, or layer has no form

    Example

     const layerId = 3
    const featureId = 4
    // in this exemple we fetch the feature from the server, but we could get from the map
    // with the following method JMap.Map.getRenderedFeatures
    const feature = await JMap.Feature.getById(layerId, featureId)
    // opens form update dialog for one element of layer id=3
    JMap.Form
    .openUpdateDialogForLayer(
    layerId,
    [{
    id: featureId,
    attributeValueByName: feature.properties
    }]
    )
    .then(formsMetadata => console.log("Update form dialog opened", formsMetadata))
    .catch(error => console.error(error))