ArcGIS Runtime SDK for Qt

FeatureLayer extrusion

Loading

Code

import QtQuick 2.6
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import Esri.ArcGISRuntime 100.4
import Esri.ArcGISExtras 1.1

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

    property real scaleFactor: System.displayScaleFactor

    SceneView {
        id: sceneView
        anchors.fill: parent        

        Scene {
            id: scene
            BasemapImagery {}

            ServiceFeatureTable {
                id: featureTable
                url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3"
            }

            FeatureLayer {
                id: featureLayer
                featureTable: featureTable
                renderingMode: Enums.FeatureRenderingModeDynamic
                renderer: renderer
            }

            Surface {
                id: baseSurface
                ArcGISTiledElevationSource {
                    url: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
                }
            }

            ViewpointCenter {
                Point {
                    id: lookAtPoint
                    x: -99.659448
                    y: 20.513652
                    z: 12940924
                    spatialReference: SpatialReference { wkid: 4326 }
                }
                targetScale: 12940924

                Camera {
                    id: initialCamera
                    location: lookAtPoint
                    roll: 0
                    pitch: 15
                    heading: 0
                }
            }
        }

        // combo box to update the extrusion
        ComboBox {
            anchors {
                top: parent.top
                left: parent.left
                margins: 10 * scaleFactor
            }
            width: 200 * scaleFactor
            model: ["TOTAL POPULATION", "POPULATION DENSITY"]

            onCurrentTextChanged: {
                if (currentText === "TOTAL POPULATION")
                    sceneProperties.extrusionExpression = "[POP2007] / 10";
                else
                    sceneProperties.extrusionExpression = "([POP07_SQMI] * 5000) + 100000";
            }
        }

        SimpleRenderer {
            id: renderer
            symbol: fillSymbol
            sceneProperties: sceneProperties
        }

        RendererSceneProperties {
            id: sceneProperties
            extrusionMode: Enums.ExtrusionModeAbsoluteHeight
            extrusionExpression: "[POP2007] / 10"
        }

        SimpleFillSymbol {
            id: fillSymbol
            color: "blue"
            outline: lineSymbol
        }

        SimpleLineSymbol {
            id: lineSymbol
            color: "black"
        }
    }
}


In this topic
  1. Code