• JMap.Form.createAttributeFormElement

    Creates an attribute form element.

    Works only for attribute form.

    Parameters

    Returns Promise<GeoJSON.Feature>

    Throws

    if layer not found, if form not found, or form is not an attribute form, or invalid parameter

    Example

    // returns the new created feature
    JMap.Form
    .createAttributeFormElement({
    layerId: 3,
    formId: 4,
    attributeValueByName: {
    color: "green",
    type: "tree"
    },
    geometry: {
    type: "Point",
    coordinates: [43.55843, 6.55121]
    }
    })
    .then(feature => console.log("New feature created:", feature))
    .catch(error => console.error("An error occurred while creating new feature", error))