-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.html
1021 lines (872 loc) · 43.1 KB
/
sample.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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="description" content="Utah Geologic and Mineral Resources">
<title>Utah Geologic and Mineral Resources</title>
<!-- Calcite Maps Bootstrap -->
<link rel="stylesheet" href="https://esri.github.io/calcite-maps/dist/css/calcite-maps-bootstrap.min-v0.10.css">
<!-- Calcite Maps -->
<link rel="stylesheet" href="https://esri.github.io/calcite-maps/dist/css/calcite-maps-arcgis-4.x.min-v0.10.css">
<!--link rel="stylesheet" href="../../dist/css/calcite-maps.min-v0.10.css"-->
<!-- works -->
<!-- ArcGIS JS 4 -->
<link rel="stylesheet" href="https://js.arcgis.com/4.10/esri/css/main.css">
<link rel="stylesheet" href="../tests/lightbox2/dist/css/lightbox.min.css">
<style>
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
.calcite-panels.calcite-panels-left.calcite-bg-custom.calcite-text-light.calcite-bgcolor-dark.panel-group {
top: 61%;
}
.esri-layer-list__item-actions-menu-item:first-of-type {
display: none;
}
.tab {
margin-left: 4%;
}
.esri-legend__layer-caption {
display: none;
}
.esri-legend__message {
display: none;
}
.esri-layer-list__child-toggle+.esri-layer-list__item-label>.esri-layer-list__item-toggle {
display: none;
}
a {
cursor: pointer;
}
.esri-layer-list__item-actions-menu-item--active,
.esri-layer-list__item-actions-menu-item--active:hover {
background-color: whitesmoke;
}
.calcite-title:before {
content: url('/apps/jay/tests/UGS-blm.png');
padding: 6px 12px 0 2px;
cursor: pointer;
}
.esri-layer-list__item-container .tooltiptext {
visibility: hidden;
width: 120px;
background-color: ivory;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;
position: absolute;
z-index: 1;
}
.esri-layer-list__item-container:hover .tooltiptext {
visibility: visible;
}
.calcite-maps .calcite-search-expander .esri-search__sources-button.esri-widget--button {
display: block !important;
}
.calcite-maps .calcite-search-expanded .esri-menu.esri-search__sources-menu {
display: block !important;
}
</style>
</head>
<body class="calcite-maps calcite-nav-top">
<!-- Navbar -->
<a class="ugs-watermark " href="https://geology.utah.gov"></a>
<nav class="navbar calcite-navbar navbar-fixed-top calcite-text-light calcite-bg-dark calcite-bgcolor-dark">
<!-- Menu -->
<div class="dropdown calcite-dropdown calcite-bg-light calcite-text-dark" role="presentation">
<a class="dropdown-toggle" role="menubutton" aria-haspopup="true" aria-expanded="false" tabindex="0">
<div class="calcite-dropdown-toggle">
<span class="sr-only">Toggle dropdown menu</span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</a>
<ul class="dropdown-menu calcite-menu">
<li><a class="active hidden-md hidden-lg" href="#mapTab" aria-controls="mapTab" role="tab"
data-toggle="tab"> 2D</a></li>
<li><a class="hidden-md hidden-lg" href="#sceneTab" aria-controls="sceneTab" role="tab"
data-toggle="tab"> 3D</a></li>
<li><a role="menuitem" tabindex="0" data-target="#panelInfo" aria-haspopup="true"><span
class="esri-icon-notice-round"></span> About</a></li>
<li><a role="menuitem" tabindex="0" data-target="#panelDisclaimer" aria-haspopup="true"><span
class="esri-icon-notice-triangle"></span> Disclaimer</a></li>
<li><a role="menuitem" tabindex="0" data-target="#panelLegend" aria-haspopup="true"><span
class="glyphicon glyphicon-list-alt"></span> Legend</a></li>
<li><a role="menuitem" tabindex="0" data-target="#panelBasemaps" aria-haspopup="true"><span
class="esri-icon-basemap"></span> Basemaps</a></li>
<!-- <li><a role="menuitem" tabindex="0" data-target="#calciteLocate" id="calciteLocate" aria-haspopup="true"><span class="glyphicon glyphicon-map-marker"></span> Locate</a></li> -->
<!-- <li><a role="menuitem" tabindex="0" id="calciteToggleNavbar" aria-haspopup="true"><span class="glyphicon glyphicon-fullscreen"></span> Full Map</a></li> -->
</ul>
</div>
<!-- Title -->
<div class="calcite-title calcite-overflow-hidden">
<span class="calcite-title-main">Utah Geological Survey</span>
<span class="calcite-title-divider hidden-xs"></span>
<span class="calcite-title-sub hidden-xs">Utah Geologic and Mineral Resources</span>
</div>
<!-- Nav -->
<ul class="calcite-nav nav navbar-nav">
<!-- <li><a id="mapNav" class="hidden-xs hidden-sm" href="#mapTab" aria-controls="mapTab" aria-expanded="true" role="tab" data-toggle="tab" data-tooltip="tip" title="2D View" data-placement="bottom">2D View</a></li>
<li class="active"><a id="sceneNav" class="hidden-xs hidden-sm" href="#sceneTab" aria-controls="mapTab" role="tab" data-toggle="tab" data-tooltip="tip" title="3D View" data-placement="bottom">3D View</a></li> -->
<li>
<div class="calcite-navbar-search calcite-search-expander" role="presentation" tabindex="-1">
<div id="searchNavDiv" tabindex="0"></div>
</div>
</li>
</ul>
</nav>
<!--/.navbar -->
<!-- Map Container -->
<div class="calcite-map calcite-map-absolute">
<div id="tabContainer" class="tab-content">
<div id="mapTab" class="tab-pane fade in active" role="tabpanel">
<div id="mapViewDiv"></div>
</div>
<!-- <div id="sceneTab" class="tab-pane fade in active" role="tabpanel">
<div id="sceneViewDiv"></div>
</div> -->
</div>
</div>
<!-- Panel Container -->
<!-- Panel - Legend -->
<div class="calcite-panels calcite-panels-left calcite-bg-custom calcite-text-light calcite-bgcolor-dark panel-group"
role="tablist" aria-multiselectable="true">
<div id="panelLegend" class="panel collapse in">
<div id="headingLegend" class="panel-heading" role="tab">
<div class="panel-title">
<a class="panel-toggle" role="button" data-toggle="collapse" href="#collapseLegend"
aria-expanded="true" aria-controls="collapseLegend"><span class="glyphicon glyphicon-list-alt"
aria-hidden="true"></span><span class="panel-label">Legend</span></a>
<a class="panel-close" role="button" data-toggle="collapse" tabindex="0" href="#panelLegend"><span
class="esri-icon esri-icon-close" aria-hidden="true"></span></a>
</div>
</div>
<div id="collapseLegend" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingLegend">
<div class="panel-body">
<div id="legendDiv"></div>
</div>
</div>
</div>
</div>
<div class="calcite-panels calcite-panels-right calcite-bg-custom calcite-text-light calcite-bgcolor-dark panel-group"
role="tablist" aria-multiselectable="true">
<!-- Info Panel -->
<div id="panelInfo" class="panel collapse in">
<div id="headingInfo" class="panel-heading" role="tab">
<div class="panel-title">
<a class="panel-toggle" role="button" data-toggle="collapse" href="#collapseInfo"
aria-expanded="true" aria-controls="collapseInfo"><span class="esri-icon-notice-round"
aria-hidden="true"></span><span class="panel-label">About</span></a>
<a class="panel-close" role="button" data-toggle="collapse" tabindex="0" href="#panelInfo"><span
class="esri-icon esri-icon-close" aria-hidden="true"></span></a>
</div>
</div>
<div id="collapseInfo" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingInfo">
<div class="panel-body">
<p><strong>BLM UTAH MINERAL RESOURCES</strong></p>
<p align="justify">This web map application was created by the Utah Geological Survey (UGS) in
cooperation with the U.S. Bureau of Land Management (BLM) to show geologic resources on BLM land
and statewide mineral resources in Utah. Use the links below to download the map data.
<br /><br /><a href="https://ugspub.nr.utah.gov/publications/open_file_reports/ofr-695.pdf"
target="_blank"><span style="color: blue;"> Utah Mining Districts publication</span></a>
<br /><a href="https://geology.utah.gov/docs/zip/Mining_Districts_20190116gdb.zip"
target="_blank"><span style="color: blue;"> Utah Mining Districts GIS data</span></a>
<br /><a href="https://geology.utah.gov/docs/zip/Utah_IM_GIS.zip" target="_blank"><span
style="color: blue;"> Industrial Mineral GIS data</span></a> <br /><br /><strong>Layer
Information</strong></p>
<p><br />GeoSights on BLM Land</p>
<p class="tab" style="padding-left: 20px;">A collection of Utah's lesser-known geologic wonders
(from UGS Survey Notes).</p>
<p><br />Rockhounding Sites on BLM Land</p>
<p class="tab" style="padding-left: 20px;">Utah rockhounding sites (from UGS publication MP-95-4 by
Wilson).</p>
<p><br /><br /></p>
</div>
</div>
</div>
<!-- Basemaps Panel -->
<div id="panelBasemaps" class="panel collapse">
<div id="headingBasemaps" class="panel-heading" role="tab">
<div class="panel-title">
<a class="panel-toggle collapsed" role="button" data-toggle="collapse" href="#collapseBasemaps"
aria-expanded="false" aria-controls="collapseBasemaps"><span class="esri-icon-basemap"
aria-hidden="true"></span><span class="panel-label">Basemaps</span></a>
<a class="panel-close" role="button" data-toggle="collapse" tabindex="0" href="#panelBasemaps"><span
class="esri-icon esri-icon-close" aria-hidden="true"></span></a>
</div>
</div>
<div id="collapseBasemaps" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="headingBasemaps">
<div class="panel-body">
<select id="selectBasemapPanel" class="form-control">
<option value="streets" data-vector="streets-vector">Streets</option>
<option value="satellite" data-vector="satellite">Satellite</option>
<option value="hybrid" data-vector="hybrid">Hybrid</option>
<option value="national-geographic" data-vector="national-geographic">National Geographic
</option>
<option value="topo" data-vector="topo-vector" selected="">Topographic</option>
<option value="gray" data-vector="gray-vector">Gray</option>
<option value="dark-gray" data-vector="dark-gray-vector">Dark Gray</option>
<option value="osm" data-vector="osm">Open Street Map</option>
<option value="dark-gray" data-vector="streets-night-vector">Streets Night</option>
<option value="streets" data-vector="streets-navigation-vector">Streets Mobile</option>
</select>
</div>
</div>
</div>
<!-- Grid panelSearch panel -->
<div id="panelGrid" class="panel collapse">
<div id="headingInfo" class="panel-heading" role="tab">
<div class="panel-title">
<a class="panel-toggle" role="button" data-toggle="collapse" href="#collapseGrid"
aria-expanded="false" aria-controls="collapseGrid"><span class="glyphicon glyphicon-list-alt"
aria-hidden="true"></span><span class="panel-label">Search Results</span></a>
<a class="panel-close" role="button" data-toggle="collapse" data-target="#panelGrid"><span
class="esri-icon esri-icon-close" aria-hidden="true"></span></a>
</div>
</div>
<div id="collapseGrid" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingGrid">
<div class="panel-body">
<div id="grid"></div>
<!-- <div id="results" class="results"></div> -->
</div>
</div>
</div>
<!-- Attribute Details panel -->
<div id="panelDetails" class="panel collapse">
<div id="headingInfo" class="panel-heading" role="tab">
<div class="panel-title">
<a class="panel-toggle" role="button" data-toggle="collapse" href="#collapseDetails"
aria-expanded="true" aria-controls="collapseDetails"><span class="glyphicon glyphicon-list-alt"
aria-hidden="true"></span><span class="panel-label" id="details">All Available Sample
Data</span></a>
<a class="panel-close" role="button" data-toggle="collapse" data-target="#panelDetails"><span
class="esri-icon esri-icon-close" aria-hidden="true"></span></a>
</div>
</div>
<div id="collapseDetails" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingDetails">
<div class="panel-body">
<div id="attDetails"></div>
</div>
</div>
</div>
<!-- Disclaimer panel -->
<div id="panelDisclaimer" class="panel collapse">
<div id="headingInfo" class="panel-heading" role="tab">
<div class="panel-title">
<a class="panel-toggle" role="button" data-toggle="collapse" href="#collapseDisclaimer"
aria-expanded="true" aria-controls="collapseDisclaimer"><span class="esri-icon-notice-triangle"
aria-hidden="true"></span><span class="panel-label">Disclaimer</span></a>
<a class="panel-close" role="button" data-toggle="collapse" data-target="#panelDisclaimer"><span
class="esri-icon esri-icon-close" aria-hidden="true"></span></a>
</div>
</div>
<div id="collapseDisclaimer" class="panel-collapse collapse" role="tabpanel"
aria-labelledby="headingDisclaimer">
<div class="panel-body">
<p style="text-align: justify;">Although this product represents the work of professional
scientists, the Utah Department of Natural Resources, Utah Geological Survey and U.S. Department
of the Interior, U.S. Bureau of Land Management make no warranty, expressed or implied,
regarding its suitability for any particular use. The Utah Department of Natural Resources, Utah
Geological Survey, and U.S. Department of the Interior, U.S. Bureau of Land Management shall not
be liable under any circumstances for any direct, indirect, special, incidental, or
consequential damages with respect to claims by users of this product. The Utah Geological
Survey and U.S. Bureau of Land Management do not guarantee accuracy or completeness of the data.
The views and conclusions contained in this document are those of the authors and should not be
interpreted as necessarily representing the official policies, either expressed or implied, of
the U.S. Government. Persons or agencies using these data specifically agree not to misrepresent
the data, nor to imply that changes they made were approved by the Utah Geological Survey, and
should indicate the data source and any modifications made on plots, digital copies, derivative
products, and in metadata. The authors' determinations of resource potential DO NOT imply a
determination of locatability for claim-staking purposes. The authors' determinations of
resource potential also DO NOT imply potential for development of mineral resources.</p>
</div>
</div>
</div>
</div> <!-- /.calcite-panels -->
<script src="https://momentjs.com/downloads/moment.js"></script>
<script src="../tests/lightbox2/dist/js/lightbox-plus-jquery.min.js"></script>
<script type="text/javascript">
var dojoConfig = {
packages: [{
name: "bootstrap",
location: "https://esri.github.io/calcite-maps/dist/vendor/dojo-bootstrap"
},
{
name: "calcite-maps",
location: "https://esri.github.io/calcite-maps/dist/js/dojo"
}
]
};
</script>
<!-- ArcGIS JS 4 -->
<script src="https://js.arcgis.com/4.10/"></script>
<script>
var app;
require([
"esri/Map",
"esri/Basemap",
"esri/Graphic",
"esri/layers/FeatureLayer",
"esri/layers/GroupLayer",
"esri/views/MapView",
"esri/views/SceneView",
"esri/support/ContentElement/Attachments",
"esri/widgets/Search",
"esri/core/watchUtils",
"esri/widgets/Home",
"esri/widgets/Zoom",
"esri/widgets/Compass",
"esri/widgets/Locate",
"esri/widgets/Legend",
"esri/widgets/BasemapToggle",
"esri/widgets/LayerList",
"esri/tasks/QueryTask",
"esri/tasks/support/Query",
"dojo/query",
"dojo/_base/declare",
"dojo/request",
// Calcite-maps
"calcite-maps/calcitemaps-v0.10",
"calcite-maps/calcitemaps-arcgis-support-v0.10",
// Bootstrap
"bootstrap/Collapse",
"bootstrap/Dropdown",
"bootstrap/Tab",
"dojo/on",
"dojo/dom",
"dojo/dom-construct",
"dojo/domReady!"
], function (Map, Basemap, Graphic, FeatureLayer, GroupLayer, MapView, SceneView,
AttachmentsContentElement, Search, watchUtils, Home, Zoom, Compass, Locate, Legend, BasemapToggle,
LayerList, QueryTask, Query, query, declare, request, CalciteMaps, CalciteMapsArcGIS, on, dom) {
// App
app = {
zoom: 8,
center: [-112, 39.5],
basemap: "topo",
viewPadding: {
top: 50,
bottom: 0
},
uiPadding: {
top: 15,
bottom: 15
},
map: null,
mapView: null,
sceneView: null,
activeView: null,
searchWidgetNav: null,
containerMap: "mapViewDiv",
containerScene: "sceneViewDiv"
};
// Map
app.map = new Map({
basemap: app.basemap,
//ground: "world-elevation"
});
// 2D View
app.mapView = new MapView({
container: app.containerMap, // deactivate
map: app.map,
zoom: 8,
center: [-112, 39.5],
padding: app.viewPadding,
ui: {
components: ["zoom", "compass", "home"],
padding: app.uiPadding
}
});
// 3D View
app.sceneView = new SceneView({
container: null, // activate
map: app.map,
zoom: app.zoom,
center: app.center,
padding: app.viewPadding,
ui: {
padding: app.uiPadding
}
});
// Active view is scene
setActiveView(app.mapView);
// Create search widget
app.searchWidgetNav = new Search({
container: "searchNavDiv",
view: app.activeView,
includeDefaultSources: false,
});
// Wire-up expand events
CalciteMapsArcGIS.setSearchExpandEvents(app.searchWidgetNav);
CalciteMapsArcGIS.setPopupPanelSync(app.mapView);
CalciteMapsArcGIS.setPopupPanelSync(app.sceneView);
// Menu UI - change Basemaps
query("#selectBasemapPanel").on("change", function (e) {
app.mapView.map.basemap = e.target.options[e.target.selectedIndex].dataset.vector;
app.sceneView.map.basemap = e.target.value;
});
// Tab UI - switch views
query(".calcite-navbar li a[data-toggle='tab']").on("click", function (e) {
if (e.target.text.indexOf("2D") > -1) {
syncViews(app.sceneView, app.mapView);
setActiveView(app.mapView);
} else {
syncViews(app.mapView, app.sceneView);
setActiveView(app.sceneView);
}
syncSearch(app.activeView);
});
// Views
function syncViews(fromView, toView) {
var viewPt = fromView.viewpoint.clone();
fromView.container = null;
if (fromView.type === "3d") {
toView.container = app.containerMap;
} else {
toView.container = app.containerScene;
}
toView.viewpoint = viewPt;
toView.padding = app.viewPadding;
}
// Search Widget
function syncSearch(view) {
app.searchWidgetNav.view = view;
if (app.searchWidgetNav.selectedResult) {
watchUtils.whenTrueOnce(view, "ready", function () {
app.searchWidgetNav.autoSelect = false;
app.searchWidgetNav.search(app.searchWidgetNav.selectedResult.name);
app.searchWidgetNav.autoSelect = true;
});
}
}
// Active view
function setActiveView(view) {
app.activeView = view;
}
var home = new Home({
view: app.activeView
});
app.activeView.ui.add(home, "top-left");
var locate = new Locate({
view: app.activeView
});
app.activeView.ui.add(locate, "top-left");
// Panel widgets - add legend
var legendWidget = new Legend({
//container: "legendDiv",
view: app.activeView
});
//Panel widgets - layerlist
var layerList = new LayerList({
view: app.activeView,
container: "legendDiv",
listItemCreatedFunction: function (event) {
const item = event.item;
setTimeout(function () {
var eyeArr = query('.esri-layer-list__item-toggle');
if (eyeArr.length) {
eyeArr.map(function (node) {
node.title = "Turn Layer On/Off";
});
}
}, 500);
if (item.layer.type != "group") { // don't show legend twice
item.panel = {
content: "legend",
open: true
};
if (item.layer.geometryType ==
"polygon") { //gets rid of the opacity tool for the point features
item.actionsSections = [
[{
title: "Increase opacity",
className: "esri-icon-up",
id: "increase-opacity"
}, {
title: "Decrease opacity",
className: "esri-icon-down",
id: "decrease-opacity"
}]
];
};
}
}
});
layerList.on("trigger-action", function (event) {
// Capture the action id.
var id = event.action.id;
var title = event.item.title;
if (title === "Mining Districts") {
layer = miningDistricts;
} else if (title === "Land Ownership") {
layer = adminBounds;
} else if (title === "Bentonite") {
layer = bentonite;
} else if (title === "Gypsum") {
layer = gypsum;
} else if (title === "Limestone") {
layer = limestone;
} else {
layer = dolomite;
}
if (id === "increase-opacity") {
// if the increase-opacity action is triggered, then
// increase the opacity of the GroupLayer by 0.1
if (layer.opacity < 1) {
layer.opacity += 0.1;
}
} else if (id === "decrease-opacity") {
// if the decrease-opacity action is triggered, then
// decrease the opacity of the GroupLayer by 0.1
if (layer.opacity > 0) {
layer.opacity -= 0.1;
}
}
});
//Popup Templates
rockHoundingContent = function (value, key, data) {
var content = "";
if (key === "Material") {
if (data.Material) {
content += "<span class='bold' title='Name'><b>Rockhounding </b></span><b>" + data
.Material + " Site</b>";
}
}
if (key === "Material_Description") {
if (data.Material_Description) {
content +=
"<span class='bold' title='Description'><b>Material Description: </b></span>" +
data.Material_Description;
}
}
if (key === "Site_Description_Geology") {
if (data.Site_Description_Geology) {
content +=
"<br><span class='bold' title='Description'><b>Site Geology: </b></span>" + data
.Site_Description_Geology;
}
}
if (key === "Directions_To_Site") {
if (data.Directions_To_Site) {
content +=
"<br><span class='bold' title='Description'><b>Directions To Site: </b></span>" +
data.Directions_To_Site;
}
}
return content;
}
geoSitesContent = function (value, key, data) {
var content = "";
if (key === "Picture") {
if (data.Picture) {
content += "<span class='bold' title='Photo'></span>" + "<a href='" + data.Picture +
"' data-lightbox='photo1' target='_blank'> <img src='" + data.Picture +
"' width='150' height='100'></a><br>";
}
}
if (key === "Name") {
content += "<span class='bold' title='Name'></span><b>" + data.Name + "</b><br>";
}
if (key === "Description") {
if (data.Description) {
content +=
"<br><span class='bold' title='Description'><b>Description: </b></span>" + data
.Description + "<br>";
}
}
return content;
}
miningContent = function (value, key, data) {
var content = "";
if (key === "District") {
if (data.District) {
content += "<span class='bold' title='District'></span>" + data.District +
" Mining District</b><br>";
}
}
if (key === "Commodity") {
if (data.Commodity) {
content += "<span class='bold' title='Commodity'><b>Commodity: </b></span>" + data
.Commodity + "</b><br>";
}
}
if (key === "Organized") {
if (data.Organized) {
content += "<span class='bold' title='Organized'><b>Organized: </b></span>" + data
.Organized + "</b><br>";
}
}
if (key === "Productive") {
if (data.Productive) {
content += "<span class='bold' title='Productive'><b>Productive: </b></span>" + data
.Productive + "</b><br>";
}
}
if (key === "Short_Tons") {
if (data.Short_Tons) {
content += "<span class='bold' title='Short Tons'><b>Short Tons: </b></span>" + data
.Short_Tons + "</b><br>";
}
}
if (key === "Total_Dollar_Value") {
if (data.Total_Dollar_Value) {
content +=
"<span class='bold' title='Total Dollar Value'><b>Total Dollar Value: </b></span>" +
data.Total_Dollar_Value.toLocaleString('en-US', {
style: 'currency',
currency: 'USD',
}) + "</b><br>";
}
}
return content;
}
industrialMinContent = function (value, key, data) {
var content = "";
if (key === "AGE") {
if (data.AGE) {
content += "<span class='bold' title='Age'><b>Age: </b></span>" + data.AGE +
"</b><br>";
}
}
if (key === "UNITNAME") {
if (data.UNITNAME) {
content += "<span class='bold' title='UNIT NAME'><b>Unit Name: </b></span>" + data
.UNITNAME + "</b><br>";
}
}
if (key === "Commodity") {
if (data.Commodity == "Gypsum") {
content += "<br><span class='bold' title='Show complete report for " + data
.Commodity + "'></span>" +
"<a href='https://ugspub.nr.utah.gov/publications/blm_mineral_resources/Gypsum.pdf' target='_blank'><b>Detailed Report</b></a>";
} else if (data.Commodity == "Dolomite") {
content += "<br><span class='bold' title='Show complete report for " + data
.Commodity + "'></span>" +
"<a href='https://ugspub.nr.utah.gov/publications/blm_mineral_resources/Dolomite.pdf' target='_blank'><b>Detailed Report</b></a>";
} else if (data.Commodity == "Limestone") {
content += "<br><span class='bold' title='Show complete report for " + data
.Commodity + "'></span>" +
"<a href='https://ugspub.nr.utah.gov/publications/blm_mineral_resources/Limestone.pdf' target='_blank'><b>Detailed Report</b></a>";
}
}
return content;
}
bentMinContent = function (value, key, data) {
var content = "";
if (key === "Age") {
if (data.Age) {
content += "<span class='bold' title='Age'><b>Age: </b></span>" + data.Age +
"</b><br>";
}
}
if (key === "UnitName") {
if (data.UnitName) {
content += "<span class='bold' title='UNIT NAME'><b>Unit Name: </b></span>" + data
.UnitName + "</b><br>";
}
}
if (key === "Commodity") {
if (data.Commodity) {
content += "<br><span class='bold' title='Show complete report for " + data
.Commodity + "'></span>" +
"<a href='https://ugspub.nr.utah.gov/publications/blm_mineral_resources/Bentonite.pdf' target='_blank'><b>Detailed Report</b></a><br>";
}
}
return content;
}
let attachmentsElement = new AttachmentsContentElement({
displayType: "list"
});
//remove panels when user clicks on map
app.activeView.on("click", function (event) {
app.activeView.graphics.removeAll();
query("#panelDetails").removeClass("in");
});
//renderers
const rockHoundRenderer = {
type: "simple", // autocasts as new SimpleRenderer()
symbol: {
type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
size: 8,
color: [255, 71, 68],
outline: null
}
};
const geoSitesRenderer = {
type: "simple", // autocasts as new SimpleRenderer()
symbol: {
type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
size: 8,
color: [66, 194, 244],
outline: null
}
};
//add feature layers
const rockHounding = new FeatureLayer({
url: "https://maps.dnr.utah.gov/arcgis/rest/services/UGS/BLM_Rockhounding_Sites/MapServer/0",
title: "Rockhounding Sites on BLM Land",
outFields: ["*"],
renderer: rockHoundRenderer,
popupTemplate: {
title: "<b>{Material:rockHoundingContent}</b>",
content: "{Material_Description:rockHoundingContent}<br>{Site_Description_Geology:rockHoundingContent}<br>{Directions_To_Site:rockHoundingContent}"
},
visible: false,
});
const geoSites = new FeatureLayer({
url: "https://webmaps.geology.utah.gov/arcgis/rest/services/Energy_Mineral/BLM_Mineral_Resources/MapServer/8",
title: "GeoSights on BLM Land",
outFields: ["*"],
renderer: geoSitesRenderer,
popupTemplate: {
title: "<b>{Name:geoSitesContent}</b>",
content: "{Picture:geoSitesContent}{Description:geoSitesContent}"
},
visible: false,
});
const miningDistricts = new FeatureLayer({
url: "https://webmaps.geology.utah.gov/arcgis/rest/services/Energy_Mineral/BLM_Mineral_Resources/MapServer/6",
title: "Mining Districts",
outFields: ["*"],
opacity: 0.5,
popupTemplate: {
title: "<b>{District:miningContent}</b>",
content: [{
type: "text",
text: "{Commodity:miningContent}{Organized:miningContent}{Productive:miningContent}{Short_Tons:miningContent}{Total_Dollar_Value:miningContent}"
}, {
type: "attachments"
}]
},
visible: true,
});
const bentonite = new FeatureLayer({
url: "https://webmaps.geology.utah.gov/arcgis/rest/services/Energy_Mineral/BLM_Mineral_Resources/MapServer/1",
title: "Bentonite",
opacity: 0.5,
outFields: ["*"],
popupTemplate: {
title: "<b>Bentonite Potential</b>",
content: "{Age:bentMinContent}{UnitName:bentMinContent}{Commodity:bentMinContent}"
},
visible: false,
});
const dolomite = new FeatureLayer({
url: "https://webmaps.geology.utah.gov/arcgis/rest/services/Energy_Mineral/BLM_Mineral_Resources/MapServer/2",
title: "Dolomite",
outFields: ["*"],
opacity: 0.5,
popupTemplate: {
title: "<b>Dolomite Potential</b>",
content: "{AGE:industrialMinContent}{UNITNAME:industrialMinContent}{Commodity:industrialMinContent}"
},
visible: false,
});
const gypsum = new FeatureLayer({
url: "https://webmaps.geology.utah.gov/arcgis/rest/services/Energy_Mineral/BLM_Mineral_Resources/MapServer/3",
title: "Gypsum",
outFields: ["*"],
opacity: 0.5,
popupTemplate: {
title: "<b>Gypsum Potential</b>",
content: "{AGE:industrialMinContent}{UNITNAME:industrialMinContent}{Commodity:industrialMinContent}"
},
visible: false,
});
const limestone = new FeatureLayer({
url: "https://webmaps.geology.utah.gov/arcgis/rest/services/Energy_Mineral/BLM_Mineral_Resources/MapServer/4",
title: "Limestone",
outFields: ["*"],
opacity: 0.5,
popupTemplate: {
title: "<b>Limestone Potential</b>",
content: "{AGE:industrialMinContent}{UNITNAME:industrialMinContent}{Commodity:industrialMinContent}"
},
visible: false,
});
const industrialMins = new GroupLayer({
title: "Industrial Mineral Resource Potential",
visible: true,
layers: [bentonite, dolomite, gypsum, limestone]
});
const adminlabelClass = { // autocasts as new LabelClass()
symbol: {
type: "text", // autocasts as new TextSymbol()
color: "rgba(125, 125, 125, 0.51)",
//haloColor: "black",
font: { // autocast as new Font()
family: "sans-serif",
size: 10,
weight: "bold"
}
},
labelPlacement: "always-horizontal",
labelExpressionInfo: {
expression: "$feature.ADMIN"
}
};
const adminBounds = new FeatureLayer({
url: "https://webmaps.geology.utah.gov/arcgis/rest/services/Energy_Mineral/BLM_Mineral_Resources/MapServer/11",
title: "Land Ownership",
outFields: ["*"],
legendEnabled: true,
opacity: 0.15,
visible: true,
//labelingInfo: [adminlabelClass],
});
const countylabelClass = { // autocasts as new LabelClass()
symbol: {
type: "text", // autocasts as new TextSymbol()
color: "rgba(125, 125, 125, 0.51)",
//haloColor: "black",
font: { // autocast as new Font()
family: "sans-serif",
size: 16,
weight: "bold"
}
},
labelPlacement: "always-horizontal",
labelExpressionInfo: {
expression: "$feature.NAME"
}
};
const countyLayer = new FeatureLayer({
url: "https://webmaps.geology.utah.gov/arcgis/rest/services/Energy_Mineral/BLM_Mineral_Resources/MapServer/10",
popupEnabled: false,
name: "Counties",
title: "Counties",
listMode: "hide",
opacity: 0.5,
labelingInfo: [countylabelClass],
});
const refLayers = new GroupLayer({
title: "Reference Layers",
visible: true,
layers: [adminBounds, countyLayer]
});
app.activeView.map.add(countyLayer);
app.activeView.map.add(adminBounds);
app.activeView.map.add(miningDistricts);