params needed to create a new feature
if layer not found, if form not found, or form is not an attribute form, or invalid parameter
// 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))
JMap.Form.createAttributeFormElement
Creates an attribute form element.
Works only for attribute form.