-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_nm.html
328 lines (309 loc) · 9.86 KB
/
index_nm.html
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<!DOCTYPE html>
<html lang="en">
<head>
<title>Ecan Soil Map</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
#viewDiv {
float: left;
left: 0px;
width: 80%;
height: 100%;
min-height: 100%;
background: #333;
display: block;
position: absolute;
}
html, body {
height: 100%;
}
.fill {
min-height: 100%;
height: 100%
}
.toc {
width: 20%;
float: right;
position: absolute;
right: 0px;
background: #222;
height: 100%;
min-height: 100%;
padding: 5px;
color: #9d9d9d
}
#Legend_div {
background: #86634D;
padding: 5px;
color: black;
}
.overlay {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0, 0.9);
overflow-x: hidden;
transition: 0.5s;
}
.overlay-content {
position: relative;
top: 25%;
width: 100%;
text-align: center;
margin-top: 30px;
}
.overlay a {
padding: 8px;
text-decoration: none;
font-size: 36px;
color: #818181;
display: block;
transition: 0.3s;
}
.overlay a:hover, .overlay a:focus {
color: #f1f1f1;
}
.overlay .closebtn {
position: absolute;
top: 20px;
right: 45px;
font-size: 60px;
}
@media screen and (max-height: 450px) {
.overlay a {font-size: 20px}
.overlay .closebtn {
font-size: 40px;
top: 15px;
right: 35px;
}
}
.esri-view-root {
height: 100%;
}
.esri-popup__main-container {
outline: none;
pointer-events: auto;
position: relative;
z-index: 1;
width: 250px;
max-height: 300px;
background-color: #222;
display: flex;
flex-flow: column nowrap;
color: #9d9d9d;
}
.esri-popup--is-docked-top-left .esri-popup__main-container, .esri-popup--is-docked-top-right .esri-popup__main-container, .esri-popup--is-docked-bottom-left .esri-popup__main-container, .esri-popup--is-docked-bottom-right .esri-popup__main-container {
max-height: 80%;
background: #222;
color: #9d9d9d;
}
.esri-widget {
box-sizing: border-box;
color: #9d9d9d;
font-size: 14px;
font-family: "Avenir Next W00","Helvetica Neue",Helvetica,Arial,sans-serif;
line-height: 1.3em;
background-color: #222;
}
.esri-widget, table,th,td {
color: #9d9d9d;
}
a {
color: white;
}
.esri-search {
position: absolute;
left: 40px;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.6/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="https://js.arcgis.com/4.6/esri/css/main.css">
<script src="https://js.arcgis.com/4.6/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/WebMap",
"esri/layers/GraphicsLayer",
"esri/tasks/QueryTask",
"esri/tasks/support/Query",
"esri/tasks/support/StatisticDefinition",
"esri/widgets/Search",
"esri/config",
"dojo/dom",
"dojo/on",
"dojo/domReady!"
],
function(
Map, MapView, FeatureLayer, WebMap, GraphicsLayer, QueryTask,
Query, StatisticDefinition, Search, esriConfig, dom, on
) {
// Soil Layer
var soilLayer = new FeatureLayer({
url: "https://gis.ecan.govt.nz/arcgis/rest/services/Public/MGM_Datasets/MapServer/10",
outFields: ["*"],
minScale: 0,
maxScale: 0,
renderer: null,
// create a new popupTemplate for the layer
popupTemplate: { // autocasts as new PopupTemplate()
//title: "County of {NAME}",
title: "{LongSoilName} ({SiblingProportion}% of the map unit polygon)",
//content: queryChargingStations,
content:
/*
"<p>Proportion of polygon: {SiblingProportion} % </p>" +
"<p>S-map reference:<span style=mso-spacerun:yes> </span>{SmapName} <a href={LINK} target=_blank>link</a></p>" +
"<p>NZ Soil Classification:<span style=mso-spacerun:yes> </span>{NZSCDescription}</p>" +
"<p>Topography: {Topography}</p>"+
"<p>MGM Nitrogen category: {EcanNLossMGMCategory}</p>"+
"<p>MGM Phosphorus category: {EcanPLossMGMCategory}</p>" +
"<p>Factsheet from Landcare: <a href={LINK} target=_blank>link</a></p>" +
*/
queryChargingStations
}
});
function queryChargingStations(target) {
/*
var query = new Query({
geometry: target.graphic.geometry,
//outFields: ["*"],
//spatialRelationship: "intersects",
//outStatistics: [countLevel1, countLevel2, countLevel3]
});
*/
// This graphicsLayer is used to highlight
// the county that user clicked on
graphicsLayer.removeAll();
target.graphic.symbol = selectionSymbol;
graphicsLayer.add(target.graphic);
var extent = target.graphic.geometry.extent
.clone()
.expand(3);
view.goTo({
target: extent
});
// execute the query task
/*
return queryChargingStationsTask.execute(query).then(function(
result) {
//var stats = result.features[0].attributes;
});
*/
return "<p>Proportion of polygon: {SiblingProportion} %</p>" +
"<p>S-map reference:<span style=mso-spacerun:yes> </span><a href={LINK} target=_blank>{SmapName}</a></p>" +
"<p>NZ Soil Classification:<span style=mso-spacerun:yes> </span>{NZSCDescription}</p>" +
"<p>Topography: {Topography}</p>"+
"<p>MGM Nitrogen category: {EcanNLossMGMCategory}</p>"+
"<p>MGM Phosphorus category: {EcanPLossMGMCategory}</p>" +
"<p>Factsheet from Landcare: <a href={LINK} target=_blank>link</a></p>"
}
// this graphiclayer will be used to highlight the county that was clicked.
var graphicsLayer = new GraphicsLayer();
var selectionSymbol = {
type: "simple-fill", // autocasts as new SimpleFillSymbol()
style: "none",
outline: { // autocasts as new SimpleLineSymbol()
color: "#00FFFF",
width: 3
}
};
esriConfig.portalUrl = "https://mapportal.ecan.govt.nz/arcgis"
var map = new WebMap({
portalItem: {
id: "6f5ea6ffd2e94502adb02177c28e2b35"
},
layers: [soilLayer, graphicsLayer]
});
// Create the MapView
var view = new MapView({
map: map,
popup: {
dockEnabled: true,
dockOptions: {
// Disables the dock button from the popup
buttonEnabled: false,
// Ignore the default sizes that trigger responsive docking
breakpoint: false,
}
},
container: "viewDiv"
});
var searchWidget = new Search({
view: view
});
// Add the search widget to the top left corner of the view
view.ui.add(searchWidget, {
position: "top-left"
});
});
</script>
</head>
<body>
<nav class="navbar navbar-inverse" style="margin-bottom: 0px; border-radius: 0px;">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Interim Canterbury Soil Layer</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="about.html">About</span></a>
<li><a href="provenance.html">Provenance</a></li>
<li><a href="tos.html">Terms of Use</a></li>
<!--<li style="cursor:pointer" onclick="openNav()"><a href="#">Help</a></li>-->
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://www.ecan.govt.nz/">Environment Canterbury</a></li>
<!-- <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li> -->
</ul>
</div>
</nav>
<div id="myNav" class="overlay">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
<div class="overlay-content">
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Clients</a>
<a href="#">Contact</a>
</div>
</div>
<div class="container fill"">
<!-- <h3>Right Aligned Navbar</h3>
<p>The .navbar-right class is used to right-align navigation bar buttons.</p>
<div class="row"> -->
<div class="row">
<div id="viewDiv">viewDiv</div>
<div class="toc">
<!--
<p style="font-size: 15px;">Legend</p>
<div id="Legend_div">Interim Soil Layer</div>
 
-->
<p>Clicking on an area of the map where there are soil data (<img src="brown_hex.jpg" height="15px" width="15px">) will retrieve soil information.</p>
<p>Soil map for the parts of Canterbury that do not have S‑map data and are not part of the Department of Conservation estate.</p>
<p>The map improves on the the Land Resource Inventory (LRI) information by altering the polygon linework to better match the landscape. The soil labels have been corrected and matched to a representative S‑map sibling.</p>
<p>Clicking on an area of the map where there are soil data will retrieve selected soil information about that area, displaying the resultant information in a table in the top-right corner of the map.</p>
<p>The About and Provenance sections contain information regarding the background and methods used to create the data.</p>
<p>If you were looking for New Zealand's new soils database, "S‑map", it can be accessed through <a href="http://smap.landcareresearch.co.nz/home">S-map Online</a>. When completed, S‑map will provide a seamless digital soil map coverage for New Zealand.</p>
</div>
</div>
</div>
<script>
function openNav() {
document.getElementById("myNav").style.width = "100%";
}
function closeNav() {
document.getElementById("myNav").style.width = "0%";
}
</script>
</body>
</html>