Graphics overlay (dictionary renderer) 3D

View inQMLC++
View on GitHub
Sample viewer app

This sample demonstrates applying a dictionary renderer to a graphics overlay in a 3D scene to display military symbology.

screenshot

Use case

Use a dictionary renderer on a graphics overlay to display more transient data, such as military messages coming through a local tactical network.

How it works

  1. Create a new DictionarySymbolStyle(dictionaryPath).
  2. Create a new DictionaryRenderer(symbolDictionary).
  3. Create a new GraphicsOverlay
  4. Set the dictionary renderer to the graphics overlay.
  5. Parse through the XML and create a graphic for each element.
  6. Use the _wkid key to get the geometry's spatial reference.
  7. Use the _control_points key to get the geometry's shape.
  8. Create a geometry using the shape and spatial reference from above.
  9. Create a Graphic for each attribute, utilizing it's defined geometry.
  10. Add the graphic to the graphics overlay.

Relevant API

  • DictionaryRenderer
  • DictionarySymbolStyle
  • GraphicsOverlay

Offline Data

Read more about how to set up the sample's offline data here.

Link Local Location
Mil2525d Stylx File <userhome>/ArcGIS/Runtime/Data/styles/arcade_style/mil2525d.stylx
MIL-STD-2525D XML Message File <userhome>/ArcGIS/Runtime/Data/xml/arcade_style/Mil2525DMessages.xml

About the data

The sample opens to a view of the county Wiltshire, United Kingdom. It displays military symbols illustrating a simulated combat situation in the area.

Tags

defense, military, situational awareness, tactical, visualization

Sample Code

GODictionaryRenderer_3D.qmlGODictionaryRenderer_3D.cppGODictionaryRenderer_3D.h
                                                                 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// [WriteFile Name=GraphicsOverlayDictionaryRenderer_3D, Category=DisplayInformation]
// [Legal]
// Copyright 2016 Esri.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// [Legal]

import QtQuick 2.6
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import Esri.Samples 1.0

GODictionaryRenderer_3DSample {
    id: graphicsOverlayDictionaryRenderer_3DSample
    width: 800
    height: 600

    onGraphicsLoaded: progressBar_loading.visible = false;

    // Create SceneView here, and create its Scene and GraphicsOverlay in C++ code
    SceneView {
        objectName: "sceneView"
        anchors.fill: parent
    }

    ProgressBar {
        id: progressBar_loading
        anchors {
            horizontalCenter: parent.horizontalCenter
            bottom: parent.bottom
            margins: 5
        }
        indeterminate: true
    }

    Dialog {
        modal: true
        x: Math.round(parent.width - width) / 2
        y: Math.round(parent.height - height) / 2
        standardButtons: Dialog.Ok
        visible: text.length > 0
        property alias text : textLabel.text
        property alias informativeText : detailsLabel.text
        ColumnLayout {
            Text {
                id: textLabel
                text: errorMessage
            }
            Text {
                id: detailsLabel
                text: "Please consult the README.md"
            }
        }
        onAccepted: errorAccepted()
    }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.