forked from Esri/arcgis-js-vscode-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjavascript.json
1353 lines (1353 loc) · 55.2 KB
/
javascript.json
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
{
"Add a layer from a portal item": {
"body": [
"Layer.fromPortalItem({",
"\tportalItem: {",
"\t\tid: \"${1:af1ad38816814b7eba3fe74a3b84412d}\"",
"\t}",
"}).then(function(layer) {",
"\t\tmap.add(layer);",
"});"
],
"description": "Add a new layer to the map using a portal item id. Contains a placeholder for the portal item id. AMD path: esri/layers/Layer | ESM path: @arcgis/core/layers/Layer.js",
"prefix": "addLayerFromPortalItem"
},
"Add a Search Widget": {
"body": [
"new Search({",
"\tincludeDefaultSources: false,",
"\tmaxResults: 6,",
"\tpopupEnabled: true,",
"\tsources: [...],",
"\tview: view,",
"});"
],
"description": "The Search widget provides a way to perform search operations on services or features provided by Esri",
"prefix": "searchWidget"
},
"Add a Search Widget with Custom Sources": {
"body": [
"new SearchSource({",
"\tplaceholder: \"example: 8 Boulevard du Port\",",
"\tgetSuggestions: (params) => {",
"\t\t\treturn esriRequest(url + \"search/\", {",
"\t\t\t\tquery: {",
"\t\t\t\t\tlat: view.center.latitude,",
"\t\t\t\t\tlon: view.center.longitude,",
"\t\t\t\t\tlimit: 6,",
"\t\t\t\t\tq: params.suggestTerm.replace(/ /g, \"+\")",
"\t\t\t\t},",
"\t\t\t\tresponseType: \"json\"",
"\t\t\t}).then((results) => {",
"\t\t\t\treturn results.data.features.map((feature) => {",
"\t\t\t\t\treturn {",
"\t\t\t\t\t\tkey: \"name\",",
"\t\t\t\t\t\tsourceIndex: params.sourceIndex,",
"\t\t\t\t\t\ttext: feature.properties.label",
"\t\t\t\t\t};",
"\t\t\t\t});",
"\t\t\t});",
"\t\t},",
"\t\tgetResults: (params) => {",
"\t\t\tconst operation = params.location ? \"reverse/\" : \"search/\";",
"\t\t\tlet query = {};",
"\t\t\tif (params.location) {",
"\t\t\t\tquery.lat = params.location.latitude;",
"\t\t\t\tquery.lon = params.location.longitude;",
"\t\t\t} else {",
"\t\t\t\tquery.q = params.suggestResult.text.replace(/ /g, \"+\");",
"\t\t\t\tquery.limit = 6;",
"\t\t\t}",
"\t\t\treturn esriRequest(url + operation, {",
"\t\t\t\tquery: query,",
"\t\t\t\tresponseType: \"json\"",
"\t\t\t}).then((results) => {",
"\t\t\t\tconst searchResults = results.data.features.map((feature) => {",
"\t\t\t\t\tconst graphic = new Graphic({",
"\t\t\t\t\t\tgeometry: new Point({",
"\t\t\t\t\t\t\tx: feature.geometry.coordinates[0],",
"\t\t\t\t\t\t\ty: feature.geometry.coordinates[1]",
"\t\t\t\t\t\t}),",
"\t\t\t\t\t\tattributes: feature.properties",
"\t\t\t\t\t});",
"\t\t\t\t\tconst buffer = geometryEngine.geodesicBuffer(graphic.geometry, 100, \"meters\");",
"\t\t\t\t\tconst searchResult = {",
"\t\t\t\t\t\textent: buffer.extent,",
"\t\t\t\t\t\tfeature: graphic,",
"\t\t\t\t\t\tname: feature.properties.label",
"\t\t\t\t\t};",
"\t\t\t\t\treturn searchResult;",
"\t\t\t\t});",
"\t\t\t\t",
"\t\t\t\treturn searchResults;",
"\t\t\t});",
"\t\t}",
"});"
],
"description": "The search widget provides the capability to provide search capabilities to third-party services. To use a custom source with the search widget, you must set the widget's sources property with your own custom source. To create a custom search source, you need to construct a search source with on object containing two functions, getSuggestions and getResults.",
"prefix": "searchWidgetWithCustomSources"
},
"Add a Search Widget with Multiple Sources": {
"body": [
"new Search({",
"\tallPlaceholder: \"District or Senator\",",
"\tincludeDefaultSources: false,",
"\tsources: [",
"\t\t{",
"\t\t\texactMatch: false,",
"\t\t\tlayer: featureLayerSenators,",
"\t\t\tname: \"Senators\",",
"\t\t\toutFields: [\"*\"],",
"\t\t\tplaceholder: \"example: Casey\",",
"\t\t\tresultSymbol: {",
"\t\t\t\theight: 36,",
"\t\t\t\ttype: \"picture-marker\",",
"\t\t\t\turl: \"https://developers.arcgis.com/javascript/latest//sample-code/widgets-search-multiplesource/live/images/senate.png\",",
"\t\t\t\twidth: 36",
"\t\t\t},",
"\t\t\tsearchFields: [\"Name\", \"Party\"],",
"\t\t\tsuggestionTemplate: \"{Name}, Party: {Party}\",",
"\t\t\tzoomScale: 500000",
"\t\t},",
"\t\t{",
"\t\t\tapiKey: \"YOUR API KEY\",",
"\t\t\tname: \"ArcGIS World Geocoding Service\",",
"\t\t\tplaceholder: \"example: Nuuk, GRL\",",
"\t\t\tsingleLineFieldName: \"SingleLine\",",
"\t\t\turl: \"https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer\"",
"\t\t}",
"\t],",
"\tview: view",
"});"
],
"description": "The Search widget to search multiple Layer Sources based on given fields. To use multiple sources with the Search widget, you must set the widget's sources property.",
"prefix": "searchWidgetWithSources"
},
"Add ArcGIS JS SDK require": {
"body": [
"require([",
"\t\"esri/Map\",",
"\t\"esri/views/MapView\"",
"], function(",
"\tMap,",
"\tMapView",
"){",
"\t",
"});"
],
"description": "Load the Map and MapView modules using require.",
"prefix": "require"
},
"Add ArcGIS JS SDK require (API keys)": {
"body": [
"require([",
"\t\"esri/config\",",
"\t\"esri/Map\",",
"\t\"esri/views/MapView\"",
"], function(",
"\tesriConfig,",
"\tMap,",
"\tMapView",
"){",
"\tesriConfig = \"${1:YOUR_API_KEY}\";",
"});"
],
"description": "Load the config, Map and MapView modules using require",
"prefix": "requireApiKeys"
},
"Add edges to 3D symbols": {
"body": [
"{",
"\ttype: \"${1|solid,sketch|}\",",
"\tcolor: ${2:[50, 50, 50, 0.5]},",
"\tsize: ${3:1},",
"\textensionLength: ${4:0}",
"}"
],
"description": "Add edge rendering visualization to existing symbols. Can only be applied to \"edges\" property of FillSymbol3DLayer on MeshSymbol3D or ExtrudeSymbol3DLayer on PolygonSymbol3D.",
"prefix": "edges3DProps"
},
"City scale 3D callout": {
"body": [
"{",
"\tborder: {",
"\t\tcolor: ${1:[0, 0, 0, 0.5]},",
"\t},",
"\tcolor: ${2:[255, 255, 255, 0.9]},",
"\tsize: ${3:1.5},",
"\ttype: \"line\",",
"},",
"verticalOffset: {",
"\tmaxWorldLength: 200,",
"\tminWorldLength: 20,",
"\tscreenLength: 20,",
"}"
],
"description": "Generates a Callout3D with a verticalOffset for a city scale level and the callout property. They should be set on the property \"callout\" of PointSymbol3D or LabelSymbol3D.",
"prefix": [
"callout3DSmallProps"
]
},
"Create 2D MapView from a portalItem": {
"body": [
"new MapView({",
"\tcontainer: \"${1:viewDiv}\",",
"\tmap: new WebMap({",
"\t\tportalItem: {",
"\t\t\tid: \"${2:webmap_id}\"",
"\t\t}",
"\t})",
"});"
],
"description": "Create 2D map using a WebMap and a portalItem. AMD paths: esri/views/MapView & esri/WebMap | ESM paths: @arcgis/core/views/MapView.js & @arcgis/core/WebMap.js",
"prefix": [
"MapViewWebMap"
]
},
"Create 3D map from a portalItem": {
"body": [
"new SceneView({",
"\tcontainer: \"${1:viewDiv}\",",
"\tmap: new WebScene({",
"\t\tportalItem: {",
"\t\t\tid: \"${2:webscene_id}\"",
"\t\t}",
"\t})",
"});"
],
"description": "Create 3D map using a WebScene and a portalItem. AMD paths: esri/views/SceneView & esri/WebScene | ESM Paths: @arcgis/core/views/SceneView.js & @arcgis/core/WebScene.js",
"prefix": [
"SceneViewWebScene"
]
},
"Create basic 2D map": {
"body": [
"new MapView({",
"\tcontainer: ${1:\"viewDiv\"},",
"\tmap: {",
"\t basemap: \"${2|arcgis-imagery,arcgis-imagery-standard,arcgis-imagery-labels,arcgis-light-gray,arcgis-dark-gray,arcgis-navigation,arcgis-navigation-night,arcgis-streets,arcgis-streets-night,arcgis-streets-relief,arcgis-topographic,arcgis-oceans,osm-standard,osm-standard-relief,osm-streets,osm-streets-relief,osm-light-gray,osm-dark-gray,arcgis-terrain,arcgis-community,arcgis-charted-territory,arcgis-colored-pencil,arcgis-nova,arcgis-modern-antique,arcgis-midcentury,arcgis-newspaper,arcgis-hillshade-light,arcgis-hillshade-dark|}\"",
"\t},",
"\tzoom: ${3:4},",
"\tcenter: ${4:[15, 65]}",
"});"
],
"description": "Create 2D MapView using a Map. AMD path: esri/views/MapView | ESM path: @arcgis/core/views/MapView.js",
"prefix": [
"MapViewMap"
]
},
"Create basic 3D map": {
"body": [
"new SceneView({",
"\tcontainer: \"${1:viewDiv}\",",
"\tmap: {",
"\t\tbasemap: \"${2:streets}\"",
"\t}",
"});"
],
"description": "Create 3D SceneView using a Map. AMD path: esri/views/SceneView | ESM path: @arcgis/core/views/SceneView.js",
"prefix": [
"SceneViewMap"
]
},
"Create object point 3D": {
"body": [
"{",
"\ttype: \"point-3d\",",
"\tsymbolLayers: [{",
"\t\ttype: \"object\",",
"\t\tresource: { primitive: \"${1|sphere,cylinder,cube,cone,inverted-cone,diamond,tetrahedron|}\"},",
"\t\tmaterial: { color: ${2:[255, 250, 239, 0.8]} },",
"\t\tdepth: ${3:15},",
"\t\theight: ${4:20},",
"\t\twidth: ${5:5}",
"\t}]",
"}"
],
"description": "Generate PointSymbol3D with a ObjectSymbol3DLayer",
"prefix": "pointSymbol3dProps"
},
"Create Picture marker symbol": {
"body": [
"{",
"\ttype: \"picture-marker\",",
"\turl: \"image-url\",",
"\theight: 12,",
"\twidth: 12",
"}"
],
"description": "Create a PictureMarkerSymbol, allowing custom image-based markers for points on maps",
"prefix": "pictureMarkerSymbolProps"
},
"Feature reduction cluster properties": {
"body": [
"{",
"\tclusterMaxSize: 37.5,",
"\tclusterMinSize: 16.5,",
"\tclusterRadius: 60,",
"\tlabelingInfo: [{",
"\t\tdeconflictionStrategy: \"none\",",
"\t\tlabelExpressionInfo: {",
"\t\t\texpression: `",
"\t\t\t\t\\$feature[\"cluster_count\"];",
"\t\t\t\tconst value = \\$feature[\"cluster_count\"];",
"\t\t\t\tconst num = Count(Text(Round(value)));",
"\t\t\t\tconst label = When(",
"\t\t\t\t\tnum < 4, Text(value, \"#.#\"),",
"\t\t\t\t\tnum == 4, Text(value / Pow(10, 3), \"#.0k\"),",
"\t\t\t\t\tnum <= 6, Text(value / Pow(10, 3), \"#k\"),",
"\t\t\t\t\tnum == 7, Text(value / Pow(10, 6), \"#.0m\"),",
"\t\t\t\t\tnum > 7, Text(value / Pow(10, 6), \"#m\"),",
"\t\t\t\t\tText(value, \"#,###\")",
"\t\t\t\t);",
"\t\t\t\treturn label;",
"\t\t\t`",
"\t\t},",
"\t\tsymbol: {",
"\t\t\tcolor: \"rgba(240,240,240,1)\",",
"\t\t\tfont: {",
"\t\t\t\tfamily: \"Noto Sans\",",
"\t\t\t\tsize: \"12px\",",
"\t\t\t\tweight: \"bold\"",
"\t\t\t},",
"\t\t\thaloColor: \"rgba(55,56,55,1)\",",
"\t\t\thaloSize: 0.75,",
"\t\t\ttype: \"text\"",
"\t\t},",
"\t\tlabelPlacement: \"center-center\"",
"\t}],",
"\tlabelsVisible: true,",
"\tpopupEnabled: true,",
"\tpopupTemplate: {",
"\t\tcontent: \"This cluster represents <b>{cluster_count}</b> features.\",",
"\t\tfieldInfos: [{",
"\t\t\tfieldName: \"cluster_count\",",
"\t\t\tformat: {",
"\t\t\t\tdigitSeparator: true,",
"\t\t\t\tplaces: 0",
"\t\t\t},",
"\t\t\tlabel: \"Number of features\"",
"\t\t],",
"\t\ttitle: \"Cluster summary\"",
"\t},",
"\ttype: \"cluster\",",
"}"
],
"description": "Generates the configuration for clustering in a MapView. This should be set on layers containing point geometry. This snippet is usually used to set the property \"featureReduction\" of a FeatureLayer, CSVLayer, GeoJSONLayer, WFSLayer, or OGCFeatureLayer",
"prefix": [
"featureReductionClusterProps",
"clusterConfig"
]
},
"Find a layer by it's name": {
"body": [
"view.map.layers.find( l => l.title === \"${1:LayerTitle}\" );"
],
"description": "Find a layer in the MapView by it's title",
"prefix": "findLayer"
},
"Generate a DotDensity renderer": {
"body": [
"{",
"\ttype: 'dot-density',",
"\tdotValue: ${1:initialValue},",
"\toutline: null,",
"\tlegendOptions: {",
"\t\tunit: \"${2:unitDot}\"",
"\t},",
"\tattributes: [",
"\t\t{",
"\t\t\tfield: \"${3:field_1}\",",
"\t\t\tcolor: \"${4:color_1}\",",
"\t\t\tlabel: \"${5:label_1}\"",
"\t\t},",
"\t\t{",
"\t\t\tfield: \"${6:field_2}\",",
"\t\t\tcolor: \"${7:color_2}\",",
"\t\t\tlabel: \"${8:label_2}\"",
"\t\t}",
"\t]",
"}"
],
"description": "Generate a DotDensity Renderer",
"prefix": "dotDensityRendererProps"
},
"Generate fill polygon 3D": {
"body": [
"{",
"\ttype: \"polygon-3d\",",
"\tsymbolLayers: [{",
"\t\ttype: \"fill\",",
"\t\tpattern: {",
"\t\t\ttype: \"style\",",
"\t\t\tstyle: \"${1|solid,vertical,horizontal,forward-diagonal,diagonal-cross,cross,backward-diagonal|}\"",
"\t\t},",
"\t\tmaterial: { color: ${2:[255, 250, 239, 0.8]} },",
"\t\toutline: { color: ${3:[70, 70, 70, 0.7]}}",
"\t}]",
"}"
],
"description": "Generate PolygonSymbol3D with a FillSymbol3DLayer",
"prefix": "fillPolygon3d"
},
"How features are placed on the vertical axis (z)": {
"body": [
"{",
"\tmode: \"${1|on-the-ground,relative-to-ground,absolute-height,relative-to-scene|}\",",
"\toffset: ${2:10},",
"\tfeatureExpressionInfo: {",
"\t\texpression: \"${3:Geometry(\\$feature).z\"}",
"\t},",
"\tunit: \"${4|feet,meters,kilometers,miles,us-feet,yards|}\"",
"}"
],
"description": "Specifies how features are placed on the vertical axis (z). This snippets should be used to set the property \"elevationInfo\" of a FeatureLayer, CSVLayer, WFSLayer, SceneLayer, StreamLayer, GeoJSONLayer, IntegratedMeshLayer, etc.",
"prefix": "elevationInfoProps"
},
"LabelingInfo for labels in a MapView": {
"body": [
"new LabelClass({",
"\tlabelExpressionInfo: { expression: \"${1:\\$feature.NAME}\"},",
"\tsymbol: {",
"\t\ttype: \"text\",",
"\t\tcolor: ${2:[0, 0, 0, 0.5]},",
"\t\thaloSize: ${3:1},",
"\t\thaloColor: ${4:[255, 255, 255, 0.9]}",
"\t}",
"})"
],
"description": "Creates the labelingInfo for labels in a layer for 2D maps. It in normally used in the property \"labelingInfo[]\" of a FeatureLayer, CSVLayer, GeoJSONLayer, StreamLayer, OGCFeatureLayer, or WFSLayer in 2D MapViews. AMD path: esri/layers/support/LabelClass | ESM path: @arcgis/core/layers/support/LabelClass.js",
"prefix": [
"LabelClass2D",
"labeling2d"
]
},
"LabelingInfo for labels in a SceneView": {
"body": [
"new LabelClass({",
"\tlabelExpressionInfo: { expression: \"${1:\\$feature.NAME}\"},",
"\tsymbol: {",
"\t\ttype: \"label-3d\",",
"\t\tsymbolLayers: [{",
"\t\t\ttype: \"text\",",
"\t\t\tmaterial: {",
"\t\t\t\tcolor: ${2:[0, 0, 0, 0.5]}",
"\t\t\t},",
"\t\t\thalo: {",
"\t\t\t\tsize: ${3: 1},",
"\t\t\t\tcolor: ${4:[255, 255, 255, 0.9]}",
"\t\t\t},",
"\t\t\tfont: {",
"\t\t\t\tsize: ${5: 11},",
"\t\t\t\tfamily: ${6:\"sans-serif\"}",
"\t\t\t}",
"\t\t}]",
"\t}",
"})"
],
"description": "Creates the labelingInfo for labels in a layer for 3D maps. It is normally used in the property \"labelingInfo[]\" of a FeatureLayer, SceneLayer or any layyer with that property within a SceneView. AMD path: esri/layers/support/LabelClass | ESM path: @arcgis/core/layers/support/LabelClass.js",
"prefix": [
"LabelClass3D",
"labeling3d"
]
},
"Render 2D points with a shape & color": {
"body": [
"{",
"\ttype: \"simple-marker\",",
"\tcolor: [255, 255, 255, 0.25],",
"\tsize: 12,",
"\tstyle: \"${1|circle,square,cross,x,diamond,triangle,path|}\",",
"\toutline: {",
"\t\twidth: 1,",
"\t\tcolor: [255, 255, 255, 1]",
"\t}",
"}"
],
"description": "Create a SimpleMarkerSymbol for rendering 2D Point geometries with a simple shape and color in either a MapView or a SceneView, but for 3D it is recommended to use PointSymbol3D. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics.",
"prefix": [
"simpleMarkerSymbolProps"
]
},
"Render 2D polygons geometries": {
"body": [
"{",
"\ttype: \"simple-fill\",",
"\tcolor: [0, 0, 0, 0.25],",
"\tstyle: \"${1|solid,backward-diagonal,cross,diagonal-cross,forward-diagonal,horizontal,none,vertical|}\",",
"\toutline: {",
"\t\twidth: 1,",
"\t\tcolor: [255, 255, 255, 1]",
"\t}",
"}"
],
"description": "Create a SimpleFillSymbol for rendering 2D polygon geometries in a 2D or 3D view, but for 3D it is recommended to use PolygonSymbol3D. It can be filled with a solid color, or a pattern. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics.",
"prefix": "simpleFillSymbolProps"
},
"Render 2D polyline geometries": {
"body": [
"{",
"\ttype: \"simple-line\",",
"\twidth: 1,",
"\tcolor: [255, 255, 255, 1],",
"\tstyle: \"${1|solid,none,dash,dash-dot,dot,long-dash,long-dash-dot,long-dash-dot-dot,short-dash,short-dash-dot,short-dash-dot-dot,short-dot|}\",",
"\tcap: \"${2|round,butt,square|}\",",
"\tjoin: \"${3|round,miter,bevel|}\"",
"}"
],
"description": "Create a SimpleLineSymbol for rendering 2D polyline geometries in a 2D or 3D view, but for 3D it is recommended to use LineSymbol3D. It can be used in several properties like \"symbol\" of renderers or individual graphics, but also \"outline\" of marker and fill symbols.",
"prefix": [
"simpleLineSymbolProps"
]
},
"Render 3D mesh polygon features in a 3D": {
"body": [
"{",
"\ttype: \"mesh-3d\",",
"\tsymbolLayers: [{",
"\t\ttype: \"fill\",",
"\t\tmaterial: { color: ${1:[255, 250, 239, 0.8]} },",
"\t}]",
"}"
],
"description": "Generate MeshSymbol3D with a FillSymbol3DLayer in a SceneLayer in a SceneView. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics.",
"prefix": [
"fillMesh3dProps",
"meshSymbol3DProps"
]
},
"Render all features with one symbol": {
"body": [
"{",
"\ttype: \"simple\",",
"\tsymbol: ${1:symbol}",
"}"
],
"description": "Renders all features in a Layer with one Symbol. This snippet is usually used to set the property \"renderer\" of a FeatureLayer, SceneLayer, MapImageLayer, CSVLayer, GeoJSONLayer, OGCFeatureLayer, WFSLayer, or StreamLayer.",
"prefix": [
"simpleRendererProps"
]
},
"Render an image in a repeating pattern (2D)": {
"body": [
"{",
"\ttype: \"picture-fill\",",
"\turl: \"${1:image-url}\",",
"\twidth: 12,",
"\theight: 12,",
"\txoffset: 0,",
"\tyoffset: 0",
"}"
],
"description": "PictureFillSymbol uses an image in a repeating pattern to symbolize polygon features in a 2D MapView. patterns for polygons. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics.",
"prefix": "pictureFillSymbolProps"
},
"Render points using a flat 2D icon": {
"body": [
"{",
"\ttype: \"point-3d\",",
"\tsymbolLayers: [{",
"\t\ttype: \"icon\",",
"\t\tresource: { primitive: \"${1|circle,square,cross,x,kite,triangle|}\"},",
"\t\tmaterial: { color: ${2:[255, 250, 239, 0.8]} },",
"\t\tsize: ${3:20}",
"\t}]",
"}"
],
"description": "Generate PointSymbol3D with a IconSymbol3DLayer in a SceneView. Available shapes: circle, square, cross, x, kite, and triangle. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics.",
"prefix": "pointSymbol3dIconProps"
},
"Render polygons as animated water surfaces": {
"body": [
"{",
"\ttype: \"polygon-3d\",",
"\tsymbolLayers: [{",
"\t\ttype: \"water\",",
"\t\twaveDirection: 180,",
"\t\tcolor: \"#5975a3\",",
"\t\twaveStrength: \"${1|calm,rippled,slight,moderate|}\",",
"\t\twaterbodySize: \"${2|small,medium,large|}\"",
"\t}]",
"}"
],
"description": "WaterSymbol3DLayer is used to render Polygon geometries as realistic, animated water surfaces, therefore it can only be used inside a PolygonSymbol3D. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics.",
"prefix": "waterSymbol3dLayerProps"
},
"Render polygons by extruding them": {
"body": [
"{",
"\ttype: \"polygon-3d\",",
"\tsymbolLayers: [{",
"\t\ttype: \"extrude\",",
"\t\tmaterial: { color: ${1:[255, 250, 239, 0.8]} },",
"\t\tsize: ${2:20}",
"\t}]",
"}"
],
"description": "Generate PolygonSymbol3D with a ExtrudeSymbol3DLayer to be used in a SceneView. It render polygon geometries by extruding them upward from the ground, creating a 3D volumetric object. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics.",
"prefix": [
"polygonSymbol3DExtrudeProps",
"extrudePolygon3d"
]
},
"Render polylines by extruding 2D profile": {
"body": [
"{",
"\ttype: \"line-3d\",",
"\tsymbolLayers: [{",
"\t\ttype: \"path\",",
"\t\tprofile: \"${1|circle,quad|}\",",
"\t\tmaterial: { color: ${2:[255, 250, 239, 0.8]} },",
"\t\twidth: ${3:15},",
"\t\theight: ${3:15},",
"\t\tjoin: \"${4|miter,bevel,round|}\",",
"\t\tcap: \"${5|butt,square,round,none|}\",",
"\t\tanchor: \"${6|bottom,center|}\",",
"\t\tprofileRotation: \"${7|all,heading|}\"",
"\t}]",
"}"
],
"description": "Generate LineSymbol3D with a PathSymbol3DLayer. Renders Polyline geometries by extruding a 2D profile along the line. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics.",
"prefix": [
"lineSymbol3DPathProps",
"path3d"
]
},
"Render polylines using a flat 3D line": {
"body": [
"{",
"\ttype: \"line-3d\",",
"\tsymbolLayers: [{",
"\t\ttype: \"line\",",
"\t\tmaterial: { color: ${1:[255, 250, 239, 0.8]} },",
"\t\tsize: ${2:15}",
"\t}]",
"}"
],
"description": "Generate LineSymbol3D with a LineSymbol3DLayer in a SceneView. This snippet is usually used to set the property \"symbol\" of renderers or individual graphics",
"prefix": [
"lineSymbol3DProps"
]
},
"Set color of features based on a numeric value": {
"body": [
"{",
"\tfield: \"${1:POP_POVERTY}\",",
"\tlegendOptions: {",
"\t\ttitle: \"${3:% population in poverty by county}\"",
"\t},",
"\tnormalizationField: \"${2:POP_TOT}\",",
"\tstops: [",
"\t\t{ value: ${4:0.15}, color: ${5: \"#FFFCD4\" }, label: \"${6:<15%}\" },",
"\t\t{ value: ${7:0.25}, color: ${8: \"#0D2644\" }, label: \"${9:>25%}\" }",
"\t],",
"\ttype: \"color\"",
"}"
],
"description": "Generate a ColorVariable with 2 color stops. Used to visualize features along a continuous color ramp based on the values of a numeric attribute field or an expression. This snippet is usually used to set the property \"visualVariables[]\" of a renderer class.",
"prefix": [
"colorVarProps"
]
},
"Set environment for a scene background": {
"body": [
"{",
"\tbackground: {",
"\t\ttype: \"color\",",
"\t\tcolor: ${1:[0, 0, 0, 0]}",
"\t},",
"\tstarsEnabled: false,",
"\tatmosphereEnabled: false",
"}"
],
"description": "Creates an environment object for changing the background of a scene. This snippet is usually used to set the property \"environment\" of the SceneView.",
"prefix": [
"sceneViewEnvironmentProps",
"background"
]
},
"Set size of features based on a numeric value": {
"body": [
"{",
"\ttype: \"size\",",
"\tfield: \"${1:POP_POVERTY}\",",
"\tnormalizationField: \"${2:POP_TOT}\",",
"\taxis: \"height\",",
"\tlegendOptions: {",
"\t\ttitle: \"${3:% population in poverty by county}\"",
"\t},",
"\tstops: [",
"\t\t{ value: ${4:0.15}, size: ${5:4}, label: \"${6:<15%}\" },",
"\t\t{ value: ${7:0.25}, size: ${8:12}, label: \"${9:25%}\" }",
"\t]",
"}"
],
"description": "Set size of features based on a numeric value. Creates a SizeVariable with 2 size stops. The axis property is only used in 3D. This snippet is usually used to set the property \"visualVariables[]\" of a renderer.",
"prefix": [
"sizeVisualVariableProps",
"sizeVar"
]
},
"Styles with API keys": {
"body": [
"\"${1|arcgis-imagery,arcgis-imagery-standard,arcgis-imagery-labels,arcgis-light-gray,arcgis-dark-gray,arcgis-navigation,arcgis-navigation-night,arcgis-streets,arcgis-streets-night,arcgis-streets-relief,arcgis-topographic,arcgis-oceans,osm-standard,osm-standard-relief,osm-streets,osm-streets-relief,osm-light-gray,osm-dark-gray,arcgis-terrain,arcgis-community,arcgis-charted-territory,arcgis-colored-pencil,arcgis-nova,arcgis-modern-antique,arcgis-midcentury,arcgis-newspaper,arcgis-hillshade-light,arcgis-hillshade-dark|}\""
],
"description": "Use of these basemaps requires a valid ArcGIS Online organizational subscription or an ArcGIS Enterprise license.",
"prefix": [
"basemapsWithAPIKeys"
]
},
"Styles without API keys": {
"body": [
"\"${1|satellite,hybrid,oceans,osm,terrain,dark-gray-vector,gray-vector,streets-vector,streets-night-vector,streets-navigation-vector,topo-vector,streets-relief-vector|}\""
],
"description": "List all available map styles to be used without API keys. Use of these basemaps requires an ArcGIS Developer subscription or a valid ArcGIS Online organizational subscription.",
"prefix": [
"basemapStyle",
"basemapsWithoutAPIKeys"
]
},
"Symbolize using categorical values": {
"body": [
"{",
"\ttype: \"unique-value\",",
"\tfield: \"${1:REGION}\",",
"\tdefaultSymbol: ${2:symbol},",
"\tuniqueValueInfos: [{",
"\t\tvalue: \"${3:value}\",",
"\t\tsymbol: ${4:symbol},",
"\t\tlabel: \"${5:label for the legend}\"",
"\t}]",
"}"
],
"description": "Generate a unique value renderer. This snippet is usually used to set the property \"renderer\" of a FeatureLayer, SceneLayer, MapImageLayer, CSVLayer, GeoJSONLayer, OGCFeatureLayer, WFSLayer, StreamLayer, ImageryLayer, or ImageryTileLayer",
"prefix": [
"uniqueValueRendererProps"
]
},
"Symbols based on classes or ranges": {
"body": [
"{",
"\tclassBreakInfos: [{",
"\t\tlabel: \"${1:label for the legend}\",",
"\t\tmaxValue: ${2:10},",
"\t\tminValue: ${3:0},",
"\t\tsymbol: ${4:symbol}",
"\t}],",
"\tdefaultSymbol: ${5:symbol},",
"\tfield: \"${6:MAGNITUDE}\",",
"\ttype: \"class-breaks\",",
"}"
],
"description": "Generate a ClassBreaksRenderer. This snippet is usually used to set the property \"renderer\" of a FeatureLayer, SceneLayer, MapImageLayer, CSVLayer, GeoJSONLayer, OGCFeatureLayer, WFSLayer, StreamLayer, ImageryLayer, or ImageryTileLayer.",
"prefix": [
"classBreaksRendererProps"
]
},
"World scale 3D callout": {
"body": [
"callout: {",
"\tborder: {",
"\t\tcolor: ${1:[0, 0, 0, 0.5]},",
"\t},",
"\tcolor: ${2:[255, 255, 255, 0.9]},",
"\tsize: ${3:1.5},",
"\ttype: \"line\",",
"},",
"verticalOffset: {",
"\tmaxWorldLength: 500000,",
"\tminWorldLength: 0,",
"\tscreenLength: 40,",
"}"
],
"description": "Generates a Callout3D with a verticalOffset for a world scale level and the callout property. They should be set on the property \"callout\" of PointSymbol3D or LabelSymbol3D.",
"prefix": [
"callout3DLargeProps"
]
},
"Add CSV Layer": {
"body": [
"new CSVLayer({",
"\turl: \"${1:https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv}\",",
"\tcopyright: \"${2:USGS Earthquakes}\"",
"})"
],
"description": "Add a CSVLayer (point layer) based on a CSV file (.csv, .txt) with a URL. CSV is a plain-text file format used to represent tabular data, including geographic point features (latitude, longitude). AMD path: esri/layers/CSVLayer | ESM path: @arcgis/core/layers/CSVLayer.js",
"prefix": "CSVLayer"
},
"Add CSV Layer from Blob": {
"body": [
"new CSVLayer({",
"\turl: ${2:url}",
"});"
],
"description": "Add a CSVLayer (point layer) based on a CSV file (.csv, .txt) from in-memory CSV data by passing a Blob object. AMD path: esri/layers/CSVLayer | ESM path: @arcgis/core/layers/CSVLayer.js",
"prefix": "CSVLayerFromBlob"
},
"Add GeoJSONLayer with URL": {
"body": [
"new GeoJSONLayer({",
"\turl: \"${1:https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.geojson}\",",
"\tcopyright: \"${2:USGS Earthquakes}\"",
"});"
],
"description": "Add GeoJSONLayer based on GeoJSON data with a URL. GeoJSON is a format for encoding a variety of geographic data structures. AMD path: esri/layers/GeoJSONLayer | ESM path: @arcgis/core/layers/GeoJSONLayer.js",
"prefix": "GeoJSONLayer"
},
"Create GeoRSSLayer with URL": {
"body": [
"new GeoRSSLayer({",
"\turl: \"${1:https://arcgis.github.io/arcgis-samples-javascript/sample-data/layers-georss/sample-georss.xml}\"",
"});"
],
"description": "Add GeoRSSLayer based on a GeoRSS file with a URL. GeoRSS is a format of adding geographic information to an RSS feed. The layer supports both GeoRSS-Simple and GeoRSS GML. AMD path: esri/layers/GeoRSSLayer | ESM path: @arcgis/core/layers/GeoRSSLayer.js",
"prefix": "GeoRSSLayer"
},
"Add Graphics to GraphicsLayer": {
"body": [
"new Graphic({",
"\tgeometry: ${1:Point, Polyline, Polygon,}",
"\tsymbol: ${2:simpleMarkerSymbol,simpleLineSymbol,simpleFillSymbol,}",
"});"
],
"description": "Create a Graphic to add to a GraphicsLayer via the add() method directly to the Graphics property. A GraphicsLayer contains one or more client-side Graphics. AMD path: esri/layers/GraphicsLayer | ESM path: @arcgis/core/layers/GraphicsLayer.js",
"prefix": "GraphicsLayer"
},
"Create FeatureLayer with PortalItem": {
"body": [
"new FeatureLayer({",
"\tportalItem: {",
"\t\tid: \"${1:123f4410054b43d7a0bacc1533ceb8dc}\"",
"\t}",
"});"
],
"description": "Create a FeatureLayer using an ArcGIS Enterprise PortalItem ID. A FeatureLayer can be either a spatial (has geographic features) or non-spatial (table). AMD path: esri/layers/FeatureLayer | ESM path: @arcgis/core/layers/FeatureLayer.js",
"prefix": "FeatureLayerWithPortalItem"
},
"Create FeatureLayer with Client-Side Graphics": {
"body": [
"new FeatureLayer({",
"\tfields: [",
"\t\t{",
"\t\t\tname: \"${1:ObjectID}\",",
"\t\t\talias: \"${2:ObjectID}\",",
"\t\t\ttype: \"${3:oid}\"",
"\t\t},",
"\t\t{",
"\t\t\tname: \"${4:type}\",",
"\t\t\talias: \"${5:Type}\",",
"\t\t\ttype: \"${6:string}\"",
"\t\t},",
"\t\t{",
"\t\t\tname: \"${7:recordedDate}\",",
"\t\t\talias: \"${8:recordedDate}\",",
"\t\t\ttype: \"${9:date}\"",
"\t\t}",
"\t],",
"\tdateFieldsTimeZone: \"${10:America/New_York}\",",
"\tobjectIdField: \"${11:ObjectID}\",",
"\tgeometryType: \"${12:point}\",",
"\tspatialReference: { wkid: ${13:4326} },",
"\tsource: graphics,",
"\trenderer: uvRenderer",
"});"
],
"description": "Add a FeatureLayer with Client-Side Graphics. If working with spatial layers, the geometry type of the features must be indicated. Both spatial and non-spatial feature collections require an objectId field. AMD path: esri/layers/FeatureLayer | ESM path: @arcgis/core/layers/FeatureLayer.js",
"prefix": "FeatureLayerwithClientSideGraphics"
},
"Add MapNotes Layer": {
"body": [
"new MapNotesLayer({",
"\ttitle: \"${1:My Map Notes}\"",
"});"
],
"description": "Add a MapNotesLayer. The MapNotesLayer lets you display and modify map notes (features sketched on a web map) from the Map Viewer. AMD path: esri/layers/MapNotesLayer | ESM path: @arcgis/core/layers/MapNotesLayer.js",
"prefix": "MapNotesLayer"
},
"Add OGC Feature Layer": {
"body": [
"new OGCFeatureLayer({",
"\turl: \"${1:https://vtp2.geo-solutions.it/geoserver/ogc/features}\",",
"\tcollectionId: \"${2:ne:countries50m}\"",
"});"
],
"description": "Add an OGCFeatureLayer with URL and collection ID. OGCFeatureLayer only supports collection items encoded in GeoJSON. AMD path: esri/layers/OGCFeatureLayer | ESM path: @arcgis/core/layers/OGCFeatureLayer.js",
"prefix": "OGCFeatureLayer"
},
"Add RouteLayer": {
"body": [
"new RouteLayer({",
"\tstops: [",
"\t\t{ geometry: { x: ${1:-117.1825}, y: ${2:34.054722} } },",
"\t\t{ geometry: { x: ${3:-116.545278}, y: ${4:33.830278} } }",
"\t],",
"\tpointBarriers: [",
"\t\t{ geometry: { x: ${5:-117.2}, y: ${6:34.05} } }",
"\t],",
"\tpolylineBarriers: [",
"\t\t{ geometry: { paths: [[[${7:-117.3}, ${8:34.05}], [${9:-117.5}, ${10:34.1}]]] } }",
"\t],",
"\tpolygonBarriers: [",
"\t\t{ geometry: { rings: [[[${11:-117.3}, ${12:34.05}], [${13:-117.5}, ${14:34.1}], [${15:-117.4}, ${16:34.2}], [${11}, ${12}]]] } }",
"\t]",
"});"
],
"description": "Add a RouteLayer and visualize the route using stops, point, polygon and polyline barriers. The results of a solved route include overall travel time, distance, and turn-by-turn directions. AMD path: esri/layers/RouteLayer | ESM path: @arcgis/core/layers/RouteLayer.js",
"prefix": "RouteLayer"
},
"Add Stream Layer with a URL": {
"body": [
"new StreamLayer({",
"\turl: \"${1:https://geoeventsample1.esri.com:6443/arcgis/rest/services/LABus/StreamServer}\",",
"\tpurgeOptions: {",
"\t\tdisplayCount: ${2:10000}",
"\t},",
"\tmaxReconnectionAttempts: ${3:100},",
"\tmaxReconnectionInterval: ${4:10},",
"\trenderer: ${5:renderer}",
"});"
],
"description": "Add a StreamLayer with a URL. A StreamLayer displays the observation streams, including changes to location, attributes, or both, associated with a set of tracked objects in real-time. AMD path: esri/layers/StreamLayer | ESM path: @arcgis/core/layers/StreamLayer.js",
"prefix": "StreamLayer"
},
"Add Stream Layer with WebSocketURL": {
"body": [
"new StreamLayer({",
"\twebSocketUrl: \"${1:ws://localhost:8000}\",",
"\tfields: [",
"\t\t{",
"\t\t\tname: \"OBJECTID\",",
"\t\t\talias: \"ObjectId\",",
"\t\t\ttype: \"oid\"",
"\t\t},",
"\t\t{",
"\t\t\tname: \"TRACKID\",",
"\t\t\talias: \"TrackId\",",
"\t\t\ttype: \"long\"",
"\t\t}",
"\t],",
"\ttimeInfo: {",
"\t\ttrackIdField: \"TRACKID\"",
"\t},",
"\tgeometryType: \"point\",",
"\tmaxReconnectionAttempts: ${2:100},",
"\tmaxReconnectionInterval: ${3:10},",
"\trenderer: ${4:renderer}",
"});"
],
"description": "Add a StreamLayer by referencing a custom stream service. The geometryType property is used to set the features' geometry type. AMD path: esri/layers/StreamLayer | ESM path: @arcgis/core/layers/StreamLayer.js",
"prefix": "StreamLayerwithWebSocketURL"
},
"Add Vector Tile Layer": {
"body": [
"new VectorTileLayer({",
"\turl: \"${1:https://www.arcgis.com/sharing/rest/content/items/4cf7e1fb9f254dcda9c8fbadb15cf0f8/resources/styles/root.json}\"",
"});"
],
"description": "Add a VectorTileLayer with a URL. VectorTileLayer accesses cached tiles of data and renders it in vector format. AMD path: esri/layers/VectorTileLayer | ESM path: @arcgis/core/layers/VectorTileLayer.js",
"prefix": "VectorTileLayer"
},
"Add WFS Layer": {
"body": [
"new WFSLayer({",
"\turl: \"${2:https://geobretagne.fr/geoserver/ows}\",",
"\tname: \"${3:fma:bvme_zhp_vs_culture}\"",
"});"
],
"description": "Add a WFSLayer based on an OGC Web Feature Service (WFS) with a URL. AMD path: esri/layers/WFSLayer | ESM path: @arcgis/core/layers/WFSLayer.js",
"prefix": "WFSLayer"
},
"Add Imagery Layer": {
"body": [
"new ImageryLayer({",
"\turl: ${1:serviceUrl}",
"});"
],
"description": "Add an ImageryLayer with a service URL. An ImageryLayer retrieves and displays data from dynamic image services. AMD path: esri/layers/ImageryLayer | ESM path: @arcgis/core/layers/ImageryLayer.js",
"prefix": "ImageryLayer"
},
"Add Imagery Tile Layer with COG": {
"body": [
"new ImageryTileLayerCOG({",
"\turl: \"${1:https://ss6imagery.arcgisonline.com/imagery_sample/landsat8/Bolivia_LC08_L1TP_001069_20190719_MS.tiff}\",",
"\tbandIds: [${2:3}, ${3:2}, ${4:1}]",
"});"
],
"description": "Create an ImageryTileLayer that references a Cloud Optimized GeoTiff(COG) file. A Cloud Optimized GeoTiff (COG) file is a regular GeoTiff file that is hosted on CORS enabled HTTPS server. AMD path: esri/layers/ImageryLayer | ESM path: @arcgis/core/layers/ImageryLayer.js",
"prefix": "ImageryTileLayerwithCOG"
},
"Create a Transposed Multidimensional Imagery Tile Layer": {
"body": [
"new MultidimensionalImageryTileLayer({",
"\turl: \"${1:https://tiledimageservices.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/NLDAS2011_daily_wind_magdir/ImageServer}\",",
"\ttitle: \"${2:2011 wind - 10 meters above surface}\",",
"\trenderer: {",
"\t\ttype: \"vector-field\",",
"\t\tstyle: \"${3:beaufort-m}\",",
"\t\tflowRepresentation: \"${4:flow-to}\",",
"\t\tsymbolTileSize: ${5:30},",
"\t\tvisualVariables: [",
"\t\t\t{",
"\t\t\t\ttype: \"size\",",
"\t\t\t\tfield: \"${6:Magnitude}\",",
"\t\t\t\tmaxDataValue: ${7:32},",
"\t\t\t\tmaxSize: \"${8:60px}\",",
"\t\t\t\tminDataValue: ${9:0.04},",
"\t\t\t\tminSize: \"${10:20px}\"",
"\t\t\t},",
"\t\t\t{",
"\t\t\t\ttype: \"rotation\",",
"\t\t\t\tfield: \"${11:Direction}\",",