• JMap.Layer.Search.byAttribute

    Returns features, for a given layer, having attribute value equals to the given value(s).

    Parameters

    Returns Promise<any>

    a promise that will return all the features of the Layer corresponding to the search criteria

    Throws

    Error if promise fails

    Example

    // returns all features that have the attribute "E"
    JMap.Layer.Search
    .byAttribute({
    layerId: 99,
    attributeName: "TREE",
    attributeValue: [ "Cherry", "Birch" ] // here an array for multipe values, but could be a single value like a string
    })
    .then(features => console.info(`Total ${features.length} feature(s) found`, features))
    .catch(error => console.error(error))