forked from origo-map/origo-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
3733 lines (3732 loc) · 154 KB
/
index.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>
<head>
<meta charset='utf-8' />
<meta http-equiv='X-UA-Compatible' content='IE=11' />
<title>Origo documentation</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link href='css/base.css' rel='stylesheet' />
<link href='css/style.css' rel='stylesheet' />
<link href='css/railscasts.css' rel='stylesheet' />
<link href='css/origo.css' rel='stylesheet' />
</head>
<body>
<!--START--><div id='app'><div class="container unlimiter" data-reactid=".17430mc6qnk" data-react-checksum="-1052751730"><div class="fixed-top fixed-right space-left16" data-reactid=".17430mc6qnk.0"><div class="fill-light col6 pin-right" data-reactid=".17430mc6qnk.0.0"></div></div><div class="space-top5 scroll-styled pad1 width16 sidebar fixed-left fill-dark dark" data-reactid=".17430mc6qnk.1"><div class="pad0x small" data-reactid=".17430mc6qnk.1.0"><div class="small pad0x quiet space-top1" data-reactid=".17430mc6qnk.1.0.0:$0">Introduction</div><a href="#origo-map" class="line-height15 pad0x pad00y quiet block " data-reactid=".17430mc6qnk.1.0.0:$1">Origo-map</a><a href="#creating-the-map" class="line-height15 pad0x pad00y quiet block " data-reactid=".17430mc6qnk.1.0.0:$2">Creating the map</a><div class="small pad0x quiet space-top1" data-reactid=".17430mc6qnk.1.0.0:$6">Settings</div><a href="#basic-settings" class="line-height15 pad0x pad00y quiet block " data-reactid=".17430mc6qnk.1.0.0:$7">Basic settings</a><div class="small pad0x quiet space-top1" data-reactid=".17430mc6qnk.1.0.0:$31">Controls</div><a href="#controls-1" class="line-height15 pad0x pad00y quiet block " data-reactid=".17430mc6qnk.1.0.0:$32">Controls</a><div class="small pad0x quiet space-top1" data-reactid=".17430mc6qnk.1.0.0:$76">Layers</div><a href="#layers-1" class="line-height15 pad0x pad00y quiet block " data-reactid=".17430mc6qnk.1.0.0:$77">Layers</a><a href="#source" class="line-height15 pad0x pad00y quiet block " data-reactid=".17430mc6qnk.1.0.0:$104">Source</a><a href="#attributes" class="line-height15 pad0x pad00y quiet block " data-reactid=".17430mc6qnk.1.0.0:$106">Attributes</a><div class="small pad0x quiet space-top1" data-reactid=".17430mc6qnk.1.0.0:$111">Styles</div><a href="#style-basics" class="line-height15 pad0x pad00y quiet block " data-reactid=".17430mc6qnk.1.0.0:$112">Style basics</a><a href="#style-examples" class="line-height15 pad0x pad00y quiet block " data-reactid=".17430mc6qnk.1.0.0:$132">Style examples</a><a href="#origo-map" class="space-top2 pad1y dark keyline-top block small quiet" data-reactid=".17430mc6qnk.1.0.1">Back to top</a></div></div><div class="space-left16" data-reactid=".17430mc6qnk.2"><div class="" data-reactid=".17430mc6qnk.2.0"><div class="clearfix" data-reactid=".17430mc6qnk.2.0.0"><div data-title="Origo-map" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$0"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$0.0"><h2 id="origo-map">Origo-map</h2>
<p>This is the documentation for the Origo map framework. For more information about Origo and how to download please visit us on <a href="https://github.com/origo-map/origo">GitHub</a>. If you are a new user of Origo it is recommended to take a look at the basic examples that are included on GitHub.</p>
<p>An origo map can be created once its JavaScript and CSS file is included on a page. How the map is created is explained in <a href="#creating-the-map">Creating the map</a>. All available settings and options are described and examplified in this documentation.</p>
</div></div><div data-title="Creating the map" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$1"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$1.0"><h2 id="creating-the-map">Creating the map</h2>
<p>The map is typically initialized with a json configuration as in the example to the right. As an alternative the json object can be included directly instead of a path to a json file. A third alternative is to initialize a map with an url to another origo map. The url is created with the share control. This is for example useful when you want to embed a map.</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>map configuration</code></td>
<td>json path, json or an origo url with the map configuration</td>
</tr>
<tr>
<td><code>options</code></td>
<td>optional configuration that is set before the map configuration is read.</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>crossDomain</code></td>
<td>option to allow cross origin request of map configuration. Default is true.</td>
</tr>
<tr>
<td><code>target</code></td>
<td>element id of the container for the map. Default is '#app-wrapper'.</td>
</tr>
<tr>
<td><code>baseUrl</code></td>
<td>baseUrl for the root url that is used to request map resouces with relative paths. If not provided the baseUrl is set when the map is initialized.</td>
</tr>
<tr>
<td><code>authorizationUrl</code></td>
<td>an url that triggers authorization. It can for example be used to send a wms request that will trigger authorization before the map is loaded.</td>
</tr>
<tr>
<td><code>svgSpritePath</code></td>
<td>path for svg sprites. Default is 'css/svg/'.</td>
</tr>
<tr>
<td><code>svgSprites</code></td>
<td>list of svg sprites that should be requested.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$1.1"><h4 id="example-map-with-json">Example map with json</h4>
<pre><code class="hljs"><script type=<span class="hljs-string">"text/javascript"</span>>
<span class="hljs-keyword">var</span> origo = Origo(<span class="hljs-string">'index.json'</span>);
<<span class="hljs-regexp">/script></span></code></pre>
<h4 id="example-map-with-origo-url">Example map with origo url</h4>
<pre><code class="hljs"><script type=<span class="hljs-string">"text/javascript"</span>>
<span class="hljs-keyword">var</span> origo = Origo(<span class="hljs-string">'http://www.malardalskartan.se/app/#layers=topowebbkartan_nedtonad/v/1/s/0,vasteras/v/1/s/0,samhalls_projekt/v/1/s/0&center=172605,6596280&zoom=2&pin=348078,6686310&map=malardalskartan'</span>);
<<span class="hljs-regexp">/script></span></code></pre>
<h4 id="example-map-with-options">Example map with options</h4>
<pre><code class="hljs"><script type=<span class="hljs-string">"text/javascript"</span>>
<span class="hljs-keyword">var</span> origo = Origo(<span class="hljs-string">'index.json'</span>, { <span class="hljs-attr">target</span>: <span class="hljs-string">'#the-map'</span> });
<<span class="hljs-regexp">/script></span></code></pre>
</div></div><div data-title="Basic settings" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$2"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$2.0"><h2 id="basic-settings">Basic settings</h2>
<p>Basic settings for the application include map options such as projection and extent.</p>
</div></div><div data-title="Page settings" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$3"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$3.0"><h3 id="page-settings">Page settings</h3>
<p>With the pageSettings object you can define a footer and control the visibility of the map grid.</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$3.1"><h4 id="example-page-settings-definition">Example page settings definition</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"pageSettings"</span>: {
<span class="hljs-attr">"footer"</span>: {
<span class="hljs-attr">"img"</span>: <span class="hljs-string">"img/png/logo.png"</span>,
<span class="hljs-attr">"url"</span> : <span class="hljs-string">"https://github.com/origo-map/origo"</span>,
<span class="hljs-attr">"text"</span>: <span class="hljs-string">"Origo"</span>
},
<span class="hljs-attr">"mapGrid"</span>: {
<span class="hljs-attr">"visible"</span>: <span class="hljs-literal">true</span>
}
}
}</code></pre>
</div></div><div data-title="footer" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$4"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$4.0"><h3 id="footer">footer</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>img</code></td>
<td>string</td>
<td>URL or file path to an image.</td>
</tr>
<tr>
<td><code>text</code></td>
<td>string</td>
<td>Text to be displayed.</td>
</tr>
<tr>
<td><code>url</code></td>
<td>string</td>
<td>Sets the URL for a link.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="mapGrid" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$5"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$5.0"><h3 id="mapgrid">mapGrid</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>visible</code></td>
<td>boolean</td>
<td>Sets the visibility of the map grid. Default is false.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="Map projection" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$6"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$6.0"><h3 id="map-projection">Map projection</h3>
<p>The map projection is defined with the mandatory property projectionCode. If the projection is EPSG:3857 (Web mercator) or EPSG:4326 (WGS84) then the proj4Defs is optional, otherwise it is mandatory. An optional projection extent can also be set. Projections are handled with the proj4js library. The Proj4js definitions can be found on <a href="http://epsg.io/">epsg.io</a>.</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$6.1"><h4 id="example-projection-definition">Example projection definition</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"projectionCode"</span>: <span class="hljs-string">"EPSG:3010"</span>,
<span class="hljs-attr">"proj4Defs"</span>: [
{
<span class="hljs-attr">"code"</span>: <span class="hljs-string">"EPSG:3010"</span>,
<span class="hljs-attr">"alias"</span>: <span class="hljs-string">"urn:ogc:def:crs:EPSG::3010"</span>,
<span class="hljs-attr">"projection"</span>: <span class="hljs-string">"+proj=tmerc +lat_0=0 +lon_0=16.5 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"</span>
}
],
<span class="hljs-attr">"projectionExtent"</span>: [
<span class="hljs-number">-1678505.1838360203</span>,
<span class="hljs-number">4665380</span>,
<span class="hljs-number">2431912.7361639794</span>,
<span class="hljs-number">8775797.92</span>
]
}</code></pre>
</div></div><div data-title="proj4Defs" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$7"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$7.0"><h3 id="proj4defs">proj4Defs</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>proj4Defs</code></td>
<td>array</td>
<td>The proj4 definitions for projections used in the map. Several projections can be definied but the projection set as projectionCode will be the map projection. Each projection is defined as an object. Visit
<a href="http://epsg.io/">epsg.io</a>
to find proj4 definitions. EPSG:3857 (Web mercator) and EPSG:4326 (WGS84) doesn't need to be defined.</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>code</code></td>
<td>string</td>
<td>The EPSG-name.</td>
</tr>
<tr>
<td><code>alias</code></td>
<td>string</td>
<td>An optional EPSG alias.</td>
</tr>
<tr>
<td><code>projection</code></td>
<td>string</td>
<td>The Proj4js definition for the projection.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="projectionCode" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$8"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$8.0"><h3 id="projectioncode">projectionCode</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>projectionCode</code></td>
<td>string</td>
<td>The EPSG-name for the projection that will be used when the map is created. Visit
<a href="http://epsg.io/">epsg.io</a>
to find the EPSG-code.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="projectionExtent" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$9"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$9.0"><h3 id="projectionextent">projectionExtent</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>projectionExtent</code></td>
<td>array</td>
<td>Extent that will be set for the projection.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="extent" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$10"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$10.0"><h3 id="extent">extent</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>extent</code></td>
<td>array</td>
<td>Constraining extent for map layers.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="center" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$11"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$11.0"><h3 id="center">center</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>center</code></td>
<td>array</td>
<td>The intial center coordinates for the map.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="zoom" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$12"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$12.0"><h3 id="zoom">zoom</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>zoom</code></td>
<td>number</td>
<td>Initial zoom level for the map.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="resolutions" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$13"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$13.0"><h3 id="resolutions">resolutions</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>resolutions</code></td>
<td>array</td>
<td>The resolutions used to define available zoom levels for the map. The resolutions should be valid for the base maps.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="constrainResolution" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$14"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$14.0"><h3 id="constrainresolution">constrainResolution</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>constrainResolution</code></td>
<td>boolean</td>
<td>To snap the map to the nearest defined zoom level when using touch input or the scroll wheel of a mouse to zoom. Default is false.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="enableRotation" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$15"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$15.0"><h3 id="enablerotation">enableRotation</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>enableRotation</code></td>
<td>boolean</td>
<td>To be able to rotate the map or not. Default is true.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="groups" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$16"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$16.0"><h3 id="groups">groups</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>groups</code></td>
<td>array</td>
<td>Define groups to organise layers. The group names are used in the legend control. Each group is defined as an object. A group can contain subgroups, defined as groups within a group.</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>Name of the group that identifies the group. Each name must be unique.</td>
</tr>
<tr>
<td><code>title</code></td>
<td>string</td>
<td>A title for the group. The title is visible for the user in the legend control.</td>
</tr>
<tr>
<td><code>abstract</code></td>
<td>short description of the group. Adds a show info button to the layer in legend. Optional.</td>
<td></td>
</tr>
<tr>
<td><code>expanded</code></td>
<td>boolean</td>
<td>Whether the group should be expanded not. Used by the legend control. Default is false.</td>
</tr>
<tr>
<td><code>autoExpand</code></td>
<td>boolean</td>
<td>For subgroups. Whether the subgroup should be expanded/collapsed when toggling the subgroups checkbox. Used by the legend control. Default is true.</td>
</tr>
<tr>
<td><code>groups</code></td>
<td>array</td>
<td>Array of group objects defining subgroups. Optional.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$16.1"><h4 id="example-groups">Example groups</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"groups"</span>: [
{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"GROUP"</span>,
<span class="hljs-attr">"title"</span>: <span class="hljs-string">"GROUP"</span>,
<span class="hljs-attr">"abstract"</span>: <span class="hljs-string">"This is parents group"</span>,
<span class="hljs-attr">"groups"</span>: [
{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"group"</span>,
<span class="hljs-attr">"title"</span>: <span class="hljs-string">"group"</span>,
<span class="hljs-attr">"abstract"</span>: <span class="hljs-string">"This is childrens group"</span>
}
]
}
]
}</code></pre>
</div></div><div data-title="featureinfoOptions" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$17"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$17.0"><h3 id="featureinfooptions">featureinfoOptions</h3>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>clusterFeatureinfoLevel</code></td>
<td>number</td>
<td>Zoom level where cluster layers will be identifiable. Default is 1.</td>
</tr>
<tr>
<td><code>showOverlay</code></td>
<td>boolean</td>
<td>Option to show featureinfo in overlay or sidebar. Default is true.</td>
</tr>
<tr>
<td><code>pinning</code></td>
<td>boolean</td>
<td>Option to enable/disable pinning. If enabled a pin will be placed where clicked in places with no identifiable features. Default is true.</td>
</tr>
<tr>
<td><code>hitTolerance</code></td>
<td>number</td>
<td>Option to set the hit tolerance in pixels. Features within this tolerance from a click will be considered. This makes it easier to click features on touch devices. Default is 0.</td>
</tr>
<tr>
<td><code>selectionStyles</code></td>
<td>object</td>
<td>Option to set custom selection style. Optional.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$17.1"><h4 id="example-featureinfooptions">Example featureinfoOptions</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"featureinfoOptions"</span>: {
<span class="hljs-attr">"clusterFeatureinfoLevel"</span>: <span class="hljs-number">3</span>,
<span class="hljs-attr">"showOverlay"</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">"pinning"</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">"hitTolerance"</span>: <span class="hljs-number">3</span>,
<span class="hljs-attr">"selectionStyles"</span>: {
<span class="hljs-attr">"Point"</span>: [{
<span class="hljs-attr">"circle"</span>: {
<span class="hljs-attr">"radius"</span>: <span class="hljs-number">5</span>,
<span class="hljs-attr">"stroke"</span>: {
<span class="hljs-attr">"color"</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">153</span>, <span class="hljs-number">255</span>, <span class="hljs-number">1</span>],
<span class="hljs-attr">"width"</span>: <span class="hljs-number">0</span>
},
<span class="hljs-attr">"fill"</span>: {
<span class="hljs-attr">"color"</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">153</span>, <span class="hljs-number">255</span>, <span class="hljs-number">1</span>]
}
}
}],
<span class="hljs-attr">"LineString"</span>: [{
<span class="hljs-attr">"stroke"</span>: {
<span class="hljs-attr">"color"</span>: [<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">1</span>],
<span class="hljs-attr">"width"</span>: <span class="hljs-number">5</span>
}
},
{
<span class="hljs-attr">"stroke"</span>: {
<span class="hljs-attr">"color"</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">153</span>, <span class="hljs-number">255</span>, <span class="hljs-number">1</span>],
<span class="hljs-attr">"width"</span>: <span class="hljs-number">3</span>
}
}],
<span class="hljs-attr">"Polygon"</span>: [{
<span class="hljs-attr">"stroke"</span>: {
<span class="hljs-attr">"color"</span>: [<span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">255</span>, <span class="hljs-number">1</span>],
<span class="hljs-attr">"width"</span>: <span class="hljs-number">5</span>
}
},
{
<span class="hljs-attr">"stroke"</span>: {
<span class="hljs-attr">"color"</span>: [<span class="hljs-number">0</span>, <span class="hljs-number">153</span>, <span class="hljs-number">255</span>, <span class="hljs-number">1</span>],
<span class="hljs-attr">"width"</span>: <span class="hljs-number">3</span>
}
}
]
}
}
}</code></pre>
</div></div><div data-title="clusterOptions" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$18"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$18.0"><h3 id="clusteroptions">clusterOptions</h3>
<p>Can also be set on layer or source level.</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>clusterDistance</code></td>
<td>number</td>
<td>The distance in pixels within which features will be clustered. Default is 60.</td>
</tr>
<tr>
<td><code>clusterMaxZoom</code></td>
<td>number</td>
<td>The zoom level where the features no longer will be clustered. Default is the last zoom level.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$18.1"><h4 id="example-clusteroptions">Example clusterOptions</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"clusterOptions"</span>: {
<span class="hljs-attr">"clusterDistance"</span> : <span class="hljs-number">40</span>,
<span class="hljs-attr">"clusterMaxZoom"</span> : <span class="hljs-number">2</span>
}
}</code></pre>
</div></div><div data-title="tileGridOptions" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$19"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$19.0"><h3 id="tilegridoptions">tileGridOptions</h3>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>alignBottomLeft</code></td>
<td>boolean</td>
<td>Whether to align grid to top or bottom left corner. Default is true.</td>
</tr>
<tr>
<td><code>extent</code></td>
<td>array</td>
<td>Extent for the tilegrid. Used to calculate the tiles position. If omitted maps extent is used.</td>
</tr>
<tr>
<td><code>minZoom</code></td>
<td>number</td>
<td>Minimum zoom level. Defaults to 0.</td>
</tr>
<tr>
<td><code>resolutions</code></td>
<td>array</td>
<td>Resolutions for the tilegrid. If omitted maps resolutions are used.</td>
</tr>
<tr>
<td><code>tileSize</code></td>
<td>number or array</td>
<td>Size of tiles in the tileGrid. Default is
[256,256]</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$19.1"><h4 id="example-tilegridoptions">Example tileGridOptions</h4>
<pre><code class="hljs">"tileGridOptions": {
"alignBottomLeft": false,
"tileSize": 512
}</code></pre>
</div></div><div data-title="Controls" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$20"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$20.0"><h2 id="controls-1">Controls</h2>
<p>A control is an optional module with a DOM element in a fixed position on the
screen. They can involve user input (buttons), or be informational only. The controls to be included in the maps are set in the map configuration. The order of the controls matter. For instance, adding legend before mapmenu will make it render below when overlapping. Similarily the order of the controls in the mapmenu is set by the order in the config.</p>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$20.1"><h4 id="example-setting-controls-to-be-included">Example setting controls to be included</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"controls"</span>: [
{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"geoposition"</span>,
<span class="hljs-attr">"options"</span>: {
<span class="hljs-attr">"zoomLevel"</span>: <span class="hljs-number">15</span>
}
},
{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"mapmenu"</span>
},
{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"sharemap"</span>
},
{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"print"</span>,
<span class="hljs-attr">"options"</span>: {
<span class="hljs-attr">"logo"</span>: {
<span class="hljs-attr">"cls"</span>: <span class="hljs-string">"padding-bottom-small"</span>,
<span class="hljs-attr">"src"</span>: <span class="hljs-string">"css/png/logo_print.png"</span>,
<span class="hljs-attr">"style"</span>: {
<span class="hljs-attr">"height"</span>: <span class="hljs-string">"3rem"</span>
}
}
}
},
{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"legend"</span>,
<span class="hljs-attr">"options"</span>: {
<span class="hljs-attr">"expanded"</span>: <span class="hljs-literal">false</span>
}
},
{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"search"</span>,
<span class="hljs-attr">"options"</span>: {
<span class="hljs-attr">"url"</span>: <span class="hljs-string">"http://localhost:3000/adressok"</span>,
<span class="hljs-attr">"searchAttribute"</span>: <span class="hljs-string">"NAMN"</span>,
<span class="hljs-attr">"northing"</span>: <span class="hljs-string">"N"</span>,
<span class="hljs-attr">"easting"</span>: <span class="hljs-string">"E"</span>,
<span class="hljs-attr">"title"</span>: <span class="hljs-string">"Adress"</span>
}
}
],
}</code></pre>
</div></div><div data-title="About control" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$21"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$21.0"><h3 id="about-control">About control</h3>
<p>Adds an about map control. A button is added to the menu. On button click, a splash popup will show general info about the map. <strong>NOTE</strong> - requires mapmenu control.</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>the name of the control</td>
</tr>
<tr>
<td><code>options</code></td>
<td>options for the control</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>buttontext</code></td>
<td>the button text shown in the menu</td>
</tr>
<tr>
<td><code>title</code></td>
<td>popup header text</td>
</tr>
<tr>
<td><code>content</code></td>
<td>popup content text</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$21.1"><h4 id="example-about-control">Example about control</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"about"</span>,
<span class="hljs-attr">"options"</span>: {
<span class="hljs-attr">"buttontext"</span>: <span class="hljs-string">"Om Origo"</span>,
<span class="hljs-attr">"title"</span>: <span class="hljs-string">"Om Origo"</span>,
<span class="hljs-attr">"content"</span>: <span class="hljs-string">"<p>Origo är ett ramverk för webbkartor. Ramverket bygger på JavaScript-biblioteket OpenLayers 3...</p>"</span>
}
}</code></pre>
</div></div><div data-title="Drag-and-drop control" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$22"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$22.0"><h3 id="drag-and-drop-control">Drag-and-drop control</h3>
<p>Adds the ability to drag-and-drop GeoJSON, GPX, IGC, KML and TopoJSON files to the map. Note that the layers are only temporarily available, once the map is closed the layers are lost. It is possible to drag-and-drop multiple files at once.</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>the name of the control</td>
</tr>
<tr>
<td><code>options</code></td>
<td>options for the control</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>groupName</code></td>
<td>the name of the group containing the added layers. Defaults to "egna-lager".</td>
</tr>
<tr>
<td><code>groupTitle</code></td>
<td>the title of the group containing the added layers. Used if group doesn't exist. Defaults to "Egna lager".</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$22.1"><h4 id="example-drag-and-drop-control">Example drag-and-drop control</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"draganddrop"</span>,
<span class="hljs-attr">"options"</span>: {
<span class="hljs-attr">"groupName"</span>: <span class="hljs-string">"drag-and-drop-layers"</span>,
<span class="hljs-attr">"groupTitle"</span>: <span class="hljs-string">"Drag-and-drop layers"</span>
}
}</code></pre>
</div></div><div data-title="Editor control" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$23"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$23.0"><h3 id="editor-control">Editor control</h3>
<p>Enables layer editing.</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>the name of the control</td>
</tr>
<tr>
<td><code>options</code></td>
<td>options for the control</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>editableLayers</code></td>
<td>Layers that will we handled as editable layers. The name of the layer is used as identifier to get the settings for the layer as defined in layers. Can also be configured on a per layer basis. This will be deprecated in future releases of Origo. Editable can be set as a layer property.</td>
</tr>
<tr>
<td><code>defaultLayer</code></td>
<td>Editable layer that should be chosen as default editable layer.</td>
</tr>
<tr>
<td><code>autoForm</code></td>
<td>If set to true, the attribute form will be displayed automatically after a feature has been drawn. Default is false.</td>
</tr>
<tr>
<td><code>isActive</code></td>
<td>option to set if the editor toolbar should be opened and activated by default. Default is false.</td>
</tr>
<tr>
<td><code>autoSave</code></td>
<td>if edits should be autosaved or not. Defaults to true.</td>
</tr>
<tr>
<td><code>snap</code></td>
<td>option to enable/disable snapping. Default is true.</td>
</tr>
<tr>
<td><code>snapLayers</code></td>
<td>List of layers that should have snapping enabled. Default is editableLayers.</td>
</tr>
<tr>
<td><code>drawTools</code></td>
<td>Extra draw tools besides the standard tools for Point, Line and Polygon. The tool is set for each geomtry type. Currently 'box' for 'Polygon' is the only draw tool that can be added.</td>
</tr>
<tr>
<td><code>attributes</code></td>
<td>definition of
<a href="#attributes">attributes</a>
and how they should be presented and validated in editor form. If not provided all available attributes will be shown with a standard template.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$23.1"><h4 id="example-editor-control">Example editor control</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"editor"</span>,
<span class="hljs-attr">"options"</span>: {
<span class="hljs-attr">"isActive"</span>: <span class="hljs-literal">true</span>,
<span class="hljs-attr">"autoSave"</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">"defaultLayer"</span>: <span class="hljs-string">"editor_polygon"</span>,
<span class="hljs-attr">"drawTools"</span>: {
<span class="hljs-attr">"Polygon"</span>: [<span class="hljs-string">"box"</span>]
}
}
}</code></pre>
</div></div><div data-title="External url control" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$24"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$24.0"><h3 id="external-url-control">External url control</h3>
<p>Adds a button that will send the center coordinates in an url template and opens the url in a new browser tab. When configuring more than one link, the button expands and displays a button for each url.</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>the name of the control</td>
</tr>
<tr>
<td><code>options</code></td>
<td>options for the control</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>tooltipText</code></td>
<td>the tooltip text for the button</td>
</tr>
<tr>
<td><code>links</code></td>
<td>Options for the links. Configured as a list. Available options are listed below.</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Links option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>the name of the link. Optional.</td>
</tr>
<tr>
<td><code>tooltipText</code></td>
<td>the tooltip text for the button. Optional.</td>
</tr>
<tr>
<td><code>method</code></td>
<td>the method/format that the coordinates will be send in. Valid values are “LatLon” or “XY”. Required.</td>
</tr>
<tr>
<td><code>projection</code></td>
<td>the projection of the external web map services. The projection must be defined in proj4Defs, except EPSG:4326, EPSG:4269, EPSG:3857, EPSG:3785, EPSG:900913, EPSG:102113 or GOOGLE, which are included by default. Default is EPSG:3857.</td>
</tr>
<tr>
<td><code>url</code></td>
<td>url to the external endpoint. Coordinates can be defined within curly brackets. If method is set as “LatLon” then {{LAT}} and {{LON}} must be available in the url. If method is set as “XY” then {{X}} and {{Y}} must be available. Required.</td>
</tr>
<tr>
<td><code>buttonImage</code></td>
<td>path to the button image. If not specified, a default image is displayed. Optional.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$24.1"><h4 id="example-external-url-control">Example external url control</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"externalurl"</span>,
<span class="hljs-attr">"options"</span>: {
<span class="hljs-attr">"tooltipText"</span>: <span class="hljs-string">"Kartlänkar"</span>,
<span class="hljs-attr">"links"</span>: [
{
<span class="hljs-attr">"tooltipText"</span>: <span class="hljs-string">"OpenStreetMap"</span>,
<span class="hljs-attr">"method"</span>: <span class="hljs-string">"LatLon"</span>,
<span class="hljs-attr">"projection"</span>: <span class="hljs-string">"EPSG:3857"</span>,
<span class="hljs-attr">"url"</span>: <span class="hljs-string">"https://www.openstreetmap.org/#map=17/{{LAT}}/{{LON}}"</span>,
<span class="hljs-attr">"buttonImage"</span>: <span class="hljs-string">"img/png/osm.png"</span>
},
{
<span class="hljs-attr">"tooltipText"</span>: <span class="hljs-string">"Google street view"</span>,
<span class="hljs-attr">"method"</span>: <span class="hljs-string">"LatLon"</span>,
<span class="hljs-attr">"url"</span>: <span class="hljs-string">"https://www.google.com/maps/@?api=1&map_action=pano&viewpoint={{LAT}},{{LON}}&heading=-45&pitch=10&fov=80"</span>,
<span class="hljs-attr">"buttonImage"</span>: <span class="hljs-string">"img/png/google_street_view.png"</span>
}
]
}
}</code></pre>
</div></div><div data-title="Geoposition control" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$25"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$25.0"><h3 id="geoposition-control">Geoposition control</h3>
<p>Adds a button that when clicked centers and zooms the map to the current position.</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>the name of the control</td>
</tr>
<tr>
<td><code>options</code></td>
<td>options for the control</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>active</code></td>
<td>Boolean. Whether the control should be activated on map load or not. Defaults to false.</td>
</tr>
<tr>
<td><code>panTo</code></td>
<td>Boolean. Whether to pan to users position or not. Defaults to true.</td>
</tr>
<tr>
<td><code>zoomLevel</code></td>
<td>Integer. Specifies the zoom level that will be used when a position has been aquired. If it is not specified, the map will be zoomed to the fourth closest resolution. This option has no effect if panTo is set to false.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$25.1"><h4 id="example-geoposition-control">Example geoposition control</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"geoposition"</span>,
<span class="hljs-attr">"options"</span>: {
<span class="hljs-attr">"zoomLevel"</span>: <span class="hljs-number">15</span>
}
}</code></pre>
</div></div><div data-title="Home control" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$26"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$26.0"><h3 id="home-control">Home control</h3>
<p>Sets the map extent to the one specified in the options for the control.</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>the name of the control</td>
</tr>
<tr>
<td><code>options</code></td>
<td>options for the control</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>extent</code></td>
<td>The extent to zoom to. If no extent is provided the initial extent of the map will be used.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".17430mc6qnk.2.0.0.$26.1"><h4 id="example-home-control">Example home control</h4>
<pre><code class="hljs">{
<span class="hljs-attr">"name"</span>: <span class="hljs-string">"home"</span>,
<span class="hljs-attr">"options"</span>: {
<span class="hljs-attr">"extent"</span>: [<span class="hljs-number">134966</span>, <span class="hljs-number">6593080</span>, <span class="hljs-number">176372</span>, <span class="hljs-number">6636922</span>]
}
}</code></pre>
</div></div><div data-title="Legend control" class="keyline-top section contain clearfix " data-reactid=".17430mc6qnk.2.0.0.$27"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".17430mc6qnk.2.0.0.$27.0"><h3 id="legend-control">Legend control</h3>
<p>Adds a legend control. Legend is added to menu and as a map legend to the map.</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>the name of the control</td>