ArcGIS Runtime SDK for Qt

Feature collection layer (query)

Loading

Code

import QtQuick 2.6
import QtQuick.Controls 1.4
import Esri.ArcGISRuntime 100.3

Rectangle {
    id: rootRectangle
    clip: true
    width: 800
    height: 600

    property bool busy: featureTable.queryFeaturesStatus === Enums.TaskStatusInProgress

    MapView {
        id: mapView
        anchors.fill: parent

        Map {
            id: map
            BasemapOceans {}
        }
    }

    ServiceFeatureTable {
        id: featureTable
        url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0"

        onQueryFeaturesStatusChanged: {
            if (queryFeaturesStatus !== Enums.TaskStatusCompleted)
                return;

            var featureCollectionTable = ArcGISRuntimeEnvironment.createObject("FeatureCollectionTable", {featureSet: queryFeaturesResult});

            var featureCollection = ArcGISRuntimeEnvironment.createObject("FeatureCollection");
            featureCollection.tables.append(featureCollectionTable);

            featureCollectionLayer.featureCollection = featureCollection;
        }

        Component.onCompleted: {
            queryFeatures(queryParams);
        }
    }

    QueryParameters {
        id: queryParams
        whereClause: "1=1"
    }

    FeatureCollectionLayer {
        id: featureCollectionLayer

        onFeatureCollectionChanged: {
            map.operationalLayers.append(featureCollectionLayer);
        }
    }

    BusyIndicator {
        anchors.centerIn: parent
        visible: busy
    }
}


In this topic
  1. Code