-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
7298 lines (7285 loc) · 248 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=".1nl8zdq2wlw" data-react-checksum="-823342609"><div class="fixed-top fixed-right space-left16" data-reactid=".1nl8zdq2wlw.0"><div class="fill-light col6 pin-right" data-reactid=".1nl8zdq2wlw.0.0"></div></div><div class="space-top5 scroll-styled pad1 width16 sidebar fixed-left fill-dark dark" data-reactid=".1nl8zdq2wlw.1"><div class="pad0x small" data-reactid=".1nl8zdq2wlw.1.0"><div class="small pad0x quiet space-top1" data-reactid=".1nl8zdq2wlw.1.0.0:$0">Introduction</div><a href="#origo-map" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$1">Origo-map</a><a href="#creating-the-map" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$2">Creating the map</a><div class="small pad0x quiet space-top1" data-reactid=".1nl8zdq2wlw.1.0.0:$6">Settings</div><a href="#basic-settings" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$7">Basic settings</a><div class="small pad0x quiet space-top1" data-reactid=".1nl8zdq2wlw.1.0.0:$38">Controls</div><a href="#controls-1" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$39">Controls</a><div class="small pad0x quiet space-top1" data-reactid=".1nl8zdq2wlw.1.0.0:$92">Layers</div><a href="#layers-1" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$93">Layers</a><a href="#source" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$123">Source</a><a href="#attributes" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$125">Attributes</a><a href="#attachments" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$131">Attachments</a><a href="#related-layers" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$136">Related Layers</a><a href="#automatic-default-legend-style-for-wms-layers" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$140">Automatic default (legend) style for WMS layers</a><a href="#stylepicker" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$141">stylePicker</a><a href="#texthtml-infoformat-for-wms-layers" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$144">text/html infoFormat for WMS-layers</a><div class="small pad0x quiet space-top1" data-reactid=".1nl8zdq2wlw.1.0.0:$145">Styles</div><a href="#style-basics" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$146">Style basics</a><a href="#style-examples" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$175">Style examples</a><div class="small pad0x quiet space-top1" data-reactid=".1nl8zdq2wlw.1.0.0:$188">Origo API</div><a href="#using-origo-api" class="line-height15 pad0x pad00y quiet block " data-reactid=".1nl8zdq2wlw.1.0.0:$189">Using Origo API</a><a href="#origo-map" class="space-top2 pad1y dark keyline-top block small quiet" data-reactid=".1nl8zdq2wlw.1.0.1">Back to top</a></div></div><div class="space-left16" data-reactid=".1nl8zdq2wlw.2"><div class="" data-reactid=".1nl8zdq2wlw.2.0"><div class="clearfix" data-reactid=".1nl8zdq2wlw.2.0.0"><div data-title="Origo-map" class="keyline-top section contain clearfix " data-reactid=".1nl8zdq2wlw.2.0.0.$0"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.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=".1nl8zdq2wlw.2.0.0.$1"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.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. If the map-parameter is set in the url (eg <a href="http://origoMapUrl/#map=anotherconfig">http://origoMapUrl/#map=anotherconfig</a> ), then the map configuration will be ignored and anotherconfig.json will be loaded.</p>
<p>The configuration file must strictly follow the JSON standard (<a href="https://www.json.org/">https://www.json.org/</a>) with the addition of javascript style <em>one line comments</em> and <em>block comments</em>.</p>
<p>The code for initiating Origo should always be inserted somewhere within the <code><body></code> tag and not within the <code><head></code> tag.</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>
<tr>
<td><code>breakPoints</code></td>
<td>breakpoints determining what is shown at different screen sizes.</td>
</tr>
<tr>
<td><code>breakPointsPrefix</code></td>
<td>prefix to use when styling with breakpoints. Defaults to o-media.</td>
</tr>
<tr>
<td><code>defaultControls</code></td>
<td>to override loading of default controls (scaleline, zoom, rotate, attribution and fullscreen).</td>
</tr>
<tr>
<td><code>mapState</code></td>
<td>mapState-object to override settings in the json-config.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".1nl8zdq2wlw.2.0.0.$1.1"><pre><code class="language-javascript">// This is a comment to the end of this line.
{ name: 'scaleline' }, // It does not have to start at the beginning of a line
/* This is a comment until the end of comment marker.
It can span several lines but not be nested */
</code></pre>
<h4 id="example-map-with-json">Example map with json</h4>
<pre><code class="language-javascript"><script type="text/javascript">
var origo = Origo('index.json');
</script>
</code></pre>
<h4 id="example-map-with-origo-url">Example map with origo url</h4>
<pre><code class="language-javascript"><script type="text/javascript">
var origo = Origo('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');
</script>
</code></pre>
<h4 id="example-map-with-options">Example map with options</h4>
<pre><code class="language-javascript"><script type="text/javascript">
var origo = Origo('index.json', {
target: '#the-map,
breakPoints: {
xs: [240, 320],
s: [320, 320],
m: [500, 500],
l: [768, 500]
},
breakPointsPrefix: 'o-media',
defaultControls: [
{ name: 'scaleline' },
{ name: 'zoom' },
{ name: 'rotate' },
{ name: 'attribution' },
{ name: 'fullscreen' }
],
mapState: {
"layers": [
"osm/v/1/s/0/o/100",
"origo-mask/v/1/s/0/o/25",
"origo-cities/v/1/s/0/o/100"
],
"center": "1810000,8390000",
"zoom": "8.7",
"legend": "expanded",
"map": "index"
}
});
</script>
</code></pre>
</div></div><div data-title="Basic settings" class="keyline-top section contain clearfix " data-reactid=".1nl8zdq2wlw.2.0.0.$2"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.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. Note that all OpenLayers map and view settings of string, number or boolean type (or arrays/objects thereof) can be set in the config file, on the first level. Please see the OpenLayers <a href="https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html#Map">map</a> or <a href="https://openlayers.org/en/latest/apidoc/module-ol_View-View.html#View">view</a> documentation for more information about available settings.</p>
</div></div><div data-title="Page settings" class="keyline-top section contain clearfix " data-reactid=".1nl8zdq2wlw.2.0.0.$3"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.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=".1nl8zdq2wlw.2.0.0.$3.1"><h4 id="example-page-settings-definition">Example page settings definition</h4>
<pre><code class="language-json">{
"pageSettings": {
"footer": {
"img": "img/png/logo.png",
"url" : "https://github.com/origo-map/origo",
"text": "Origo"
},
"mapGrid": {
"visible": true
},
"mapInteractions": {
"embedded": false
}
}
}
</code></pre>
</div></div><div data-title="footer" class="keyline-top section contain clearfix " data-reactid=".1nl8zdq2wlw.2.0.0.$4"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.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=".1nl8zdq2wlw.2.0.0.$5"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.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="mapInteractions" class="keyline-top section contain clearfix " data-reactid=".1nl8zdq2wlw.2.0.0.$6"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$6.0"><h3 id="mapinteractions">mapInteractions</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>embedded</code></td>
<td>boolean</td>
<td>Sets if special map interactions for embedded maps should be used or not. Default is true.</td>
</tr>
</tbody>
</table>
</div></div><div data-title="Map projection" class="keyline-top section contain clearfix " data-reactid=".1nl8zdq2wlw.2.0.0.$7"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$7.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=".1nl8zdq2wlw.2.0.0.$7.1"><h4 id="example-projection-definition">Example projection definition</h4>
<pre><code class="language-json">{
"projectionCode": "EPSG:3010",
"proj4Defs": [
{
"code": "EPSG:3010",
"alias": "urn:ogc:def:crs:EPSG::3010",
"projection": "+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"
}
],
"projectionExtent": [
-1678505.1838360203,
4665380,
2431912.7361639794,
8775797.92
]
}
</code></pre>
</div></div><div data-title="proj4Defs" class="keyline-top section contain clearfix " data-reactid=".1nl8zdq2wlw.2.0.0.$8"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$8.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=".1nl8zdq2wlw.2.0.0.$9"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$9.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=".1nl8zdq2wlw.2.0.0.$10"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$10.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=".1nl8zdq2wlw.2.0.0.$11"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$11.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=".1nl8zdq2wlw.2.0.0.$12"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$12.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=".1nl8zdq2wlw.2.0.0.$13"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$13.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=".1nl8zdq2wlw.2.0.0.$14"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$14.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="groups" class="keyline-top section contain clearfix " data-reactid=".1nl8zdq2wlw.2.0.0.$15"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$15.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>description</code></td>
<td>string</td>
<td>description of the group. Shown on the properties page. Optional.</td>
</tr>
<tr>
<td><code>abstract</code></td>
<td>string</td>
<td>short description of the group. Shown on the properties page unless showAbstractInLegend is true. Optional.</td>
</tr>
<tr>
<td><code>showAbstractInLegend</code></td>
<td>boolean</td>
<td>if abstract should be placed in the legend instead of on the properties page. Default is false.</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>
<tr>
<td><code>exclusive</code></td>
<td>boolean</td>
<td>Setting to true will prevent activating more than one layer in the group. Defaults to false.</td>
</tr>
<tr>
<td><code>toggleAll</code></td>
<td>boolean</td>
<td>For subgroups. Set to false to disable the option to show/hide all layers in the subgroup at once. Will have no effect if exclusive is set to true. Default is true.</td>
</tr>
<tr>
<td><code>draggable</code></td>
<td>boolean</td>
<td>Set to true to be able to rearrange layers in the group and affect the drawing order. Default is false.</td>
</tr>
<tr>
<td><code>opacityControl</code></td>
<td>boolean</td>
<td>Set to true to show opacity slider on the properties page. Default is false.</td>
</tr>
<tr>
<td><code>zoomToExtent</code></td>
<td>boolean</td>
<td>Set to true to be able to zoom to specified extent.
<code>extent</code>
must also be set. Default is false.</td>
</tr>
<tr>
<td><code>extent</code></td>
<td>array</td>
<td>array of extent to zoom to with zoomToExtent.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".1nl8zdq2wlw.2.0.0.$15.1"><h4 id="example-groups">Example groups</h4>
<pre><code class="language-json">{
"groups": [
{
"name": "GROUP",
"title": "GROUP",
"abstract": "This is parents group",
"groups": [
{
"name": "group",
"title": "group",
"abstract": "This is childrens group",
"exclusive": true
}
]
}
]
}
</code></pre>
</div></div><div data-title="featureinfoOptions" class="keyline-top section contain clearfix " data-reactid=".1nl8zdq2wlw.2.0.0.$16"><div class="space-bottom8 col6 pad2x prose clip" data-reactid=".1nl8zdq2wlw.2.0.0.$16.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>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>infowindow</code></td>
<td>string</td>
<td>Option to show featureinfo in overlay, sidebar or infowindow. Default is overlay.</td>
</tr>
<tr>
<td><code>infowindowOptions</code></td>
<td>object</td>
<td>Options for infowindow. Currently only useful when using infowindow as infowindow. See options below. Optional.</td>
</tr>
<tr>
<td><code>selectionStyles</code></td>
<td>object</td>
<td>Option to set custom selection style. Optional.</td>
</tr>
<tr>
<td><code>multiSelectionStyles</code></td>
<td>object</td>
<td>Option to set custom selection style for
<code>selected</code>
features, features
<code>inActiveLayer</code>
and
<code>highlighted</code>
features when using infowindow as infowindow. Optional.</td>
</tr>
<tr>
<td><code>toggleSelectOnClick</code></td>
<td>boolean</td>
<td>Option to enable/disable selection toggling. Used with the multiselection plugin and defaults to false.</td>
</tr>
<tr>
<td><code>changePointerOnHover</code></td>
<td>boolean</td>
<td>When set to true, the mouse pointer changes when hovering over a clickable object. Optional. Defaults to false.</td>
</tr>
<tr>
<td><code>imageFeatureInfoMode</code></td>
<td>string</td>
<td>Option to set the map level featureinfo mode for image type (WMS, AGS_MAP/TILE etc) layers. The default is
<code>pixel</code>
which will produce feature info if the pixel targeted of a feature of a visible layer isn't totally transparent. Alternatives are
<code>visible</code>
which works on wholly transparent styles too and
<code>always</code>
which will produce feature info even for layers that are not visible. This option is available at the layer level as well and where present there will override the map level option. Optional.</td>
</tr>
<tr>
<td><code>autoplay</code></td>
<td>number</td>
<td>Option to let a carousel attribute images to rotate, set a number in milliseconds. Optional. Defaults to false.</td>
</tr>
</tbody>
</table>
<p><strong>infowindowOptions</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>title</code></td>
<td>string</td>
<td>Infowindow header text. Default is "Träffar".</td>
</tr>
<tr>
<td><code>listLayout</code></td>
<td>boolean</td>
<td>Option to show layers as a list. Default is false.</td>
</tr>
<tr>
<td><code>export</code></td>
<td>object</td>
<td>Defines settings for the export. Two different export options are possible, server side and client side. Server side export requires a server endpoint and can be configured either as a simple export or layer specific export. Currently only attributes can be sent with server side export.</td>
</tr>
<tr>
<td><code>groupAggregations</code></td>
<td>array of groupAggregation objects</td>
<td>If specified an aggregation of features in each layer is displayed for a selection. E.g. sum of all area. Multiple aggregations can be configured.</td>
</tr>
</tbody>
</table>
<p><strong>export properties</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>toasterMessages</code></td>
<td>object</td>
<td>Status message to the user. Defines messages for "success" and "fail". Default message is "Success!" and "Sorry, something went wrong, please contact your administrator." Currently only fail message is shown.</td>
</tr>
<tr>
<td><code>layerSpecificExport</code></td>
<td>array</td>
<td>Sends defined attributes from selected objects per layer to a server endpoint. Defines attributes, file name and service url for the export. Each layer is defined as an object. If specified for a layer, only layerSpecificExport is used for that layer.</td>
</tr>
<tr>
<td><code>simpleExport</code></td>
<td>object</td>
<td>Sends all attributes from selected objects per layer to a server endpoint. Defines layers and service url for the export.</td>
</tr>
<tr>
<td><code>clientExport</code></td>
<td>object</td>
<td>Configuration for exporting layers without the need of a server. Only applies if no layerSpecificExport or simpleExport is configured.</td>
</tr>
</tbody>
</table>
<p><strong>layerSpecificExport properties</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>layer</code></td>
<td>string</td>
<td>Defines a layer that can export selected objects.</td>
</tr>
<tr>
<td><code>attributesToSendToExport</code></td>
<td>array</td>
<td>Attributes to send to the export service.</td>
</tr>
<tr>
<td><code>exportUrls</code></td>
<td>array</td>
<td>Defines settings for the export. A layer can have multiple exports. Each export is defined as an object.</td>
</tr>
</tbody>
</table>
<p><strong>exportUrls properties</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>url</code></td>
<td>string</td>
<td>Url to a service. Required.</td>
</tr>
<tr>
<td><code>exportedFileName</code></td>
<td>string</td>
<td>File name and file extension for the export. The file extension must match the file extension from the service. Required.</td>
</tr>
<tr>
<td><code>button</code></td>
<td>object</td>
<td>Configuration for using a text button or a round button. Required.</td>
</tr>
</tbody>
</table>
<p><strong>simpleExport properties</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>url</code></td>
<td>string</td>
<td>Url to a service. Exports all attributes from the layer source. Can be used with excel creator in Origo server. Required.</td>
</tr>
<tr>
<td><code>layers</code></td>
<td>array of string</td>
<td>List of layer names that are allowed to export selected objects. Required. If layerSpecificExport is configured for the same layer, layerSpecificExport takes precedence over the simpleExport.</td>
</tr>
<tr>
<td><code>button</code></td>
<td>object</td>
<td>Configuration for using a text button or a round button. Required.</td>
</tr>
</tbody>
</table>
<p><strong>clientExport properties</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>layers</code></td>
<td>array of string</td>
<td>List of layer names that are allowed to export selected objects. Optional, if omitted export is allowed for all layers.</td>
</tr>
<tr>
<td><code>format</code></td>
<td>string</td>
<td>Fileformat to export to. Can be one of
<code>'geojson' | 'gpx' | 'kml'</code>
Required.</td>
</tr>
<tr>
<td><code>button</code></td>
<td>object</td>
<td>Configuration for using a text button or a round button. Required.</td>
</tr>
</tbody>
</table>
<p><strong>button properties</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>roundButton</code></td>
<td>boolean</td>
<td>If true, a round export button is displayed instead of a textbutton. Default is false.</td>
</tr>
<tr>
<td><code>roundButtonIcon</code></td>
<td>string</td>
<td>Icon for the round button. Path to an image or an icon from a library that are available as SVG sprites in Origo. Required if roundButton is true.</td>
</tr>
<tr>
<td><code>roundButtonTooltipText</code></td>
<td>string</td>
<td>Tooltip text for the round button. Required if roundButton is true.</td>
</tr>
<tr>
<td><code>buttonText</code></td>
<td>string</td>
<td>Text to display on export button. Optional. Default is 'Export'.</td>
</tr>
</tbody>
</table>
<p><strong>groupAggregation object</strong></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>layer</code></td>
<td>string</td>
<td>No</td>
</tr>
<tr>
<td><code>function</code></td>
<td>string</td>
<td>Yes</td>
</tr>
<tr>
<td><code>scalefactor</code></td>
<td>Number</td>
<td>No</td>
</tr>
<tr>
<td><code>decimals</code></td>
<td>integer</td>
<td>No</td>
</tr>
<tr>
<td><code>attribute</code></td>
<td>string</td>
<td>Yes</td>
</tr>
<tr>
<td><code>label</code></td>
<td>string</td>
<td>No</td>
</tr>
<tr>
<td><code>unit</code></td>
<td>string</td>
<td>No</td>
</tr>
<tr>
<td><code>useHectare</code></td>
<td>boolean</td>
<td>No</td>
</tr>
</tbody>
</table>
<p><strong>groupAggregation attribute functions</strong>
groupAggregation attribute functions are functions that are applied to each feature and the result is aggregated.</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>@length</code></td>
<td>Calculates the length of the feature. The result is automatically scaled to meters or kilometers unless
<code>unit</code>
is specified in which case result is in meters before scalefactor is applied.</td>
</tr>
<tr>
<td><code>@area</code></td>
<td>Calculates the area of the feature. The result is automatically scaled to m^2^, ha or km^2^ unless
<code>unit</code>
is specified in which case result is in square meters before scalefactor is applied. If
<code>useHectare</code>
is false result is not displayed as ha.</td>
</tr>
</tbody>
</table>
</div><div class="space-bottom4 col6 pad2 prose clip fill-light space-top5" data-reactid=".1nl8zdq2wlw.2.0.0.$16.1"><h4 id="example-featureinfooptions-with-overlay-as-infowindow">Example featureinfoOptions with overlay as infowindow</h4>
<pre><code class="language-json">{
"featureinfoOptions": {
"clusterFeatureinfoLevel": 3,
"infowindow": "overlay",
"pinning": false,
"hitTolerance": 3,
"selectionStyles": {
"Point": [{
"circle": {
"radius": 5,
"stroke": {
"color": [0, 153, 255, 1],
"width": 0
},
"fill": {
"color": [0, 153, 255, 1]
}
}
}],
"LineString": [{
"stroke": {
"color": [255, 255, 255, 1],
"width": 5
}
},
{
"stroke": {
"color": [0, 153, 255, 1],
"width": 3
}
}],
"Polygon": [{
"stroke": {
"color": [255, 255, 255, 1],
"width": 5
}
},
{
"stroke": {
"color": [0, 153, 255, 1],
"width": 3
}
}
]
}
}
}
</code></pre>
<h4 id="example-featureinfooptions-with-infowindow-as-infowindow">Example featureinfoOptions with infowindow as infowindow</h4>
<pre><code class="language-json">{
"featureinfoOptions": {
"clusterFeatureinfoLevel": 3,
"pinning": false,
"hitTolerance": 3,
"infowindow": "infowindow",
"infowindowOptions": {
"title": "Testtitel",
"export": {
"toasterMessages": {
"success": "OK!",
"fail": "Sorry!"
},
"simpleExport": {
"url": "url_to_service",
"layers": ["layer_1","layer_2"],
"button": {
"roundButton": false,
"buttonText": "Send to excel"
}
},
"layerSpecificExport": [
{
"layer": "layer_3",
"attributesToSendToExport": ["attribute_1","attribute_2"],
"exportUrls":[
{
"url": "url_to_service",
"exportedFileName": "filename_1.xlsx",
"button": {
"roundButton": true,
"roundButtonIcon": "#fa-download",
"roundButtonTooltipText": "Send to excel"
}
},
{
"url": "url_to_service",
"exportedFileName": "filename_2.docx",
"button": {
"roundButton": true,
"roundButtonIcon": "img/png/image.png",
"roundButtonTooltipText": "Send to word"
}
}
]
}
]
}
},
"multiSelectionStyles": {
"selected": [
{
"zIndex": 1,
"fill": {
"color": [128, 128, 128, 0.13]
},
"stroke": {
"color": [0, 0, 0, 0.13],
"width": 3
},
"circle": {
"radius": 14,
"stroke": {
"color": [0, 0, 0, 0.13],
"width": 3
},
"fill": {
"color": [128, 128, 128, 0.13]
}
}
}
],
"inActiveLayer": [
{
"zIndex": 3,
"fill": {
"color": [128, 128, 192, 0.4]
},
"stroke": {
"color": [255, 255, 255, 1],
"width": 4
},