-
Notifications
You must be signed in to change notification settings - Fork 0
/
a.qml
179 lines (151 loc) · 5.2 KB
/
a.qml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/* Copyright 2017 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.
*
*/
import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1
import QtQuick.Controls.Material 2.1
import QtGraphicalEffects 1.0
import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Controls 1.0
import Esri.ArcGISRuntime 100.1
App{
id: app
width: 421
height: 750
readonly property color primaryColor: "#3F51B5"
readonly property color accentColor: Qt.lighter(primaryColor,1.2)
readonly property color headerTextColor: "#ffffff"
readonly property color buttonBackgroundColor: accentColor
readonly property color buttonTextColor: "#ffffff"
property real scaleFactor: AppFramework.displayScaleFactor
readonly property real baseFontSize: app.width < 450*app.scaleFactor? 21 * scaleFactor:23 * scaleFactor
readonly property real titleFontSize: app.baseFontSize
readonly property real subtitleFontSize: 1.1 * app.baseFontSize
// App Page
Page{
anchors.fill: parent
// Adding App Page Header Section
header: ToolBar{
id:header
contentHeight: 56 * scaleFactor
Material.primary: app.primaryColor
RowLayout{
anchors.fill: parent
spacing:0
Item{
Layout.preferredWidth: 16*app.scaleFactor
Layout.fillHeight: true
}
Label {
Layout.fillWidth: true
text: qsTr("Mapping Application")
elide: Label.ElideRight
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
font.pixelSize: app.titleFontSize
color: app.headerTextColor
}
}
}
// Header Section ends
// TODO:-Add Code here
MapView{
id:mapView
anchors.fill: parent
Map{
BasemapImageryWithLabelsVector{}
ArcGISMapImageLayer{
id:mapImageLyr
url:"http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer"
onLoadStatusChanged: {
if(loadStatus === Enums.LoadStatusLoaded){
mapView.setViewpointGeometry(mapImageLyr.fullExtent);
}
}
}
FeatureLayer{
id:featureLayer
featureTable: table
}
ServiceFeatureTable{
id:table
url:"http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/0"
}
}
}
// App Body ends here
// Button to perform action
RoundButton{
width: radius*2
height:width
radius: 32*app.scaleFactor
anchors {
right: parent.right
bottom: parent.bottom
rightMargin:16*app.scaleFactor
bottomMargin: 48*app.scaleFactor
}
Material.elevation: 6
Material.background: app.buttonBackgroundColor
contentItem: Image {
width: parent.radius
height: width
mipmap: true
rotation: messageDialog.visible ? 45:0
source: "./assets/add.png"
Behavior on rotation{
NumberAnimation{duration: 200}
}
}
onClicked:{
messageDialog.open();
}
}
}
// Show Dialog on the button click
Dialog {
id: messageDialog
Material.accent: app.primaryColor
x: (parent.width - width)/2
y: (parent.height - height)/2
title: qsTr("LayerList")
width: Math.min(0.8 * parent.width, 400*AppFramework.displayScaleFactor)
height: parent.height/3
closePolicy: Popup.NoAutoClose
modal: true
ListView{
id:listView
anchors.fill: parent
model:mapView.map.operationalLayers
delegate: Switch{
text:name
checked: layerVisible
onCheckedChanged: {
layerVisible = checked;
}
}
}
// Label {
// id: message
// text: qsTr("Welcome to AppStudio!")
// opacity: 0.9
// wrapMode: Label.Wrap
// width: parent.width
// height: implicitHeight
// }
standardButtons: Dialog.Ok
}
}