• JMap.Query.fetchFeatures

    Process a query request to the JMap server, for given layer and query ids, and provided form data

    Parameters

    • layerId: JId

      The JMap layer id

    • queryId: string

      The JMap query id

    • data: any

      The form data (values mapping the query form definition)

    Returns Promise<any[]>

    Throws

    if group or query ids are not correct (invalid format or no resource exists)

    Example

    // returns a promise that when resolved returns the result of the search,
    // an array of features, for layer id=3 and query id=5.
    JMap.Query
    .fetchFeatures(3, 5, {
    "$PARAM1": "test",
    "$PARAM2": 35
    })
    .then(features => console.info(`Found ${features.length} features.`))
    .catch(error => console.error("Error while processing query request.", error))