Display drawing status

Loading

Code

import QtQuick 2.6
import QtQuick.Controls 1.4
import QtGraphicalEffects 1.0
import Esri.ArcGISRuntime 100.3
import Esri.ArcGISExtras 1.1

Rectangle {
    clip: true
    width: 800
    height: 600

    property real scaleFactor: System.displayScaleFactor

    // create MapView
    MapView {
        anchors.fill: parent

        // create map using topographic basemap
        Map {
            BasemapTopographic {}

            // create FeatureLayer using a service URL
            FeatureLayer {
                ServiceFeatureTable {
                    url: "http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0"
                }
            }

            // set initial viewpoint
            ViewpointExtent {
                Envelope {
                    xMin: -13639984
                    yMin: 4537387
                    xMax: -13606734
                    yMax: 4558866
                    spatialReference: SpatialReference { wkid: 3857 }
                }
            }
        }

        // make Drawing Window visible if map is drawing. Not visible if drawing completed
        onDrawStatusChanged: {
            drawStatus === Enums.DrawStatusInProgress ? mapDrawingWindow.visible = true : mapDrawingWindow.visible = false;
        }
    }

    Rectangle {
        id: mapDrawingWindow
        anchors.fill: parent
        color: "transparent"

        RadialGradient {
            anchors.fill: parent
            opacity: 0.15
            gradient: Gradient {
                GradientStop { position: 0.0; color: "lightgrey" }
                GradientStop { position: 0.7; color: "black" }
            }
        }

        // pop up to show if MapView is drawing
        Rectangle {
            anchors.centerIn: parent
            width: 100 * scaleFactor
            height: 100 * scaleFactor
            radius: 3
            opacity: 0.85
            color: "#E0E0E0"
            border.color: "black"

            Column {
                anchors.centerIn: parent
                topPadding: 5 * scaleFactor
                spacing: 5 * scaleFactor

                BusyIndicator {
                    anchors.horizontalCenter: parent.horizontalCenter
                    height: 60 * scaleFactor
                    running: true
                }

                Text {
                    anchors.horizontalCenter: parent.horizontalCenter
                    font {
                        weight: Font.Black
                        pixelSize: 12 * scaleFactor
                    }
                    height: 20 * scaleFactor
                    horizontalAlignment: Text.AlignHCenter
                    renderType: Text.NativeRendering
                    text: "Drawing..."
                }
            }
        }
    }
}


In this topic
  1. Code