• JMap.Query.initializeQueryFormById

    By default attribute query forms are not fetched from server, because sometime it takes too much time.

    This method loads the query form if needed. Concurrent calls for the same query share the load. If the form is already loaded, it returns the existing query without fetching it again. A successful load emits the queryFormLoad event. In the JMap application, this event updates the UI only when the same query is still active. Calling this method outside the query panel does not activate a query in the UI.

    Parameters

    • layerId: JId

      the JMap layer id

    • queryId: string

      The full query id, for example "layers/2/attribute-queries/3"

    Returns Promise<JQuery>

    Example

    // initializes query id="layers/2/attribute-queries/3" form of layer id=2, then returns the filled query
    JMap.Query.initializeQueryFormById(2, "layers/2/attribute-queries/3")
    .then(query => console.log("Query form has been loaded", query))
    .catch(error => console.error("An error occurred while loading query id='layers/2/attribute-queries/3'", error))