• JMap.Feature.geometryUpdateById

    Change the feature geometry for the given layer id, feature id and geometry (projection EPSG:4326).

    Parameters

    Returns Promise<GeoJSON.Feature>

    Throws

    if layer or feature not found, or if feature is invalid (undefined, wrong geometry type, etc ...)

    Example

    const newGeometry = { ... }
    // change the geometry of feature id="4" on layer id="3"
    JMap.Feature
    .geometryUpdateById({
    layerId: 3,
    featureId: 4,
    geometry: newGeometry
    })
    .then(feature => console.info("Feature geometry has been changed", feature))
    .catch(error => console.error("An error occured", error))