• JMap.Map.Selection.addFeaturesToLayerSelection

    Add to the current layer selection the provided feature(s).

    Don't cancel previous selection, but add features to it.

    Parameters

    • layerId: JId

      The JMap layer id

    • features: Feature<Geometry, GeoJsonProperties> | Feature<Geometry, GeoJsonProperties>[]

      The feature(s) that will be selected on the map

    Returns void

    Throws

    Error if layer is not found or features format is not good

    Example

    // Add one feature (id = 234) to layer 4 selection
    JMap.Map.Selection.addFeaturesToLayerSelection(4, {
    id: 234,
    type: "Point",
    geometry: {...},
    properties: [...]
    })

    // Add 2 features (id = 234 and 567) to layer 4 selection
    JMap.Map.Selection.addFeaturesToLayerSelection(4, [
    {
    id: 234,
    type: "Point",
    geometry: {...},
    properties: [...]
    },
    {
    id: 567,
    type: "Point",
    geometry: {...},
    properties: [...]
    }
    ])