-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlayers.html
1164 lines (942 loc) · 41.8 KB
/
layers.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MapFish Print 3 Documentation - Map Layers</title>
<link rel="stylesheet" href="css/sphinx_rtd_theme.css" type="text/css" />
<link rel="stylesheet" href="css/readthedocs-doc-embed.css" type="text/css" />
<link rel="stylesheet" href="css/custom.css" type="text/css" />
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> MapFish Print 3</a>
</div>
<div
class="wy-menu wy-menu-vertical"
data-spy="affix"
role="navigation"
aria-label="main navigation"
>
<ul class="current">
<li class="toctree-l1 ">
<a class="reference internal " href="index.html">Introduction</a>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="jasperreports.html"
>JasperReports</a
>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="api.html">Web API</a>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="attributes.html">Attributes</a>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="configuration.html"
>Configuration</a
>
</li>
<li class="toctree-l1 current">
<a class="reference internal current" href="layers.html">Map Layers</a>
<ul>
<li class="toctree-l2">
<a class="reference internal" href="#Geo Json Layer">Geo Json Layer</a>
<li class="toctree-l2">
<a class="reference internal" href="#Geotiff Layer">Geotiff Layer</a>
<li class="toctree-l2">
<a class="reference internal" href="#Gml Layer">Gml Layer</a>
<li class="toctree-l2">
<a class="reference internal" href="#Grid Layer">Grid Layer</a>
<li class="toctree-l2">
<a class="reference internal" href="#Image Layer">Image Layer</a>
<li class="toctree-l2">
<a class="reference internal" href="#Osm Layer">Osm Layer</a>
<li class="toctree-l2">
<a class="reference internal" href="#Tiled Wms Layer">Tiled Wms Layer</a>
<li class="toctree-l2">
<a class="reference internal" href="#WMTS Layer">WMTS Layer</a>
<li class="toctree-l2">
<a class="reference internal" href="#Wms Layer">Wms Layer</a>
</li>
</ul>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="processors.html">Processors</a>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="fileloaders.html">File-Loaders</a>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="outputformats.html"
>Output Formats</a
>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="styles.html">Styles</a>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="tableimages.html"
>Images in tables</a
>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="download.html">Download</a>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="docker.html">Docker</a>
</li>
<li class="toctree-l1 ">
<a class="reference internal " href="scaling.html">Horizontal scaling</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">MapFish Print 3</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>Map Layers</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/mapfish/mapfish-print" class="fa fa-github">
mapfish/mapfish-print</a
>
</li>
</ul>
<hr />
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1>Map Layers</h1>
<div class="section"><p>
The map layers are the geospatial data types supported by Mapfish Print. Map layers are typically defined in
the request JSON as part of the map attribute. Since map layers are essentially attribute data specific to
the map attribute, they follow the same pattern as all other attributes in that they have attribute values.
</p>
<p>
The documentation below describes each map layer listing its required and optional attributes. Here is an
example of a map attribute with map layers defined.
</p>
<p>
<strong>Example <code>request.json</code></strong>
</p>
<div class="highlight-json">
<div class="highlight">
<pre>
{
"attributes": {
"map": {
"layers": [
{
"geoJson": "http://host.org/data.geojson",
"type": "geojson"
},
{
"baseURL": "http://host.org/tiles",
"type": "OSM",
"imageExtension": "png"
}
],
"projection": "EPSG:3857",
"dpi": 128,
"scale": 100000,
"center": [
-8233518.5005945,
4980320.4059228
]
}
},
"layout": "A4 landscape"
}</pre
>
</div>
</div>
</div>
<div class="section" id="Geo Json Layer">
<h1>Geo Json Layer<a class="headerlink" href="#Geo Json Layer" title="Permalink to this headline">¶</a></h1>
<div class="block">Renders GeoJSON layers.
<p>Type: <code>geojson</code>
</p></div>
<div class="admonition note examples">
<p class="first admonition-title">Example</p>
<p class="last">
<a
href="https://github.com/mapfish/mapfish-print/tree/master/examples/src/test/resources/examples/json_styling"
target="_blank"
class="fa fa-book"
> json_styling</a
> <a
href="https://github.com/mapfish/mapfish-print/tree/master/examples/src/test/resources/examples/datasource_multiple_maps"
target="_blank"
class="fa fa-book"
> datasource_multiple_maps</a
> <a
href="https://github.com/mapfish/mapfish-print/tree/master/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857"
target="_blank"
class="fa fa-book"
> printwms_tyger_ny_EPSG_3857</a
>
</p>
</div>
<h3>Configuration</h3>
<dl>
<dt><code>parser</code> </dt>
<dd></dd>
</dl>
<h3>Inputs</h3>
<dl>
<dt><code>failOnError</code> </dt>
<dd><div class="block">Fail if a tile return an error.</div></dd>
</dl>
<dl>
<dt><code>geoJson</code> </dt>
<dd><div class="block">A geojson formatted string or url to the geoJson or the raw GeoJSON data.
<p>The url can be a file url, however if it is it must be relative to the configuration
directory.</p></div></dd>
</dl>
<dl>
<dt><code>name</code> </dt>
<dd><div class="block">The name of the layer.</div></dd>
</dl>
<dl>
<dt><code>opacity</code> </dt>
<dd><div class="block">The opacity of the image.</div></dd>
</dl>
<dl>
<dt><code>renderAsSvg</code> </dt>
<dd><div class="block">Indicates if the layer is rendered as SVG.
<p>(will default to <code>Configuration.defaultToSvg</code>).</p></div></dd>
</dl>
<dl>
<dt><code>style</code> </dt>
<dd><div class="block">The style name of a style to apply to the features during rendering. The style name must map to
a style in the template or the configuration objects.
<p>If no style is defined then the default style for the geometry type will be used.</p></div></dd>
</dl>
</div>
<div class="section" id="Geotiff Layer">
<h1>Geotiff Layer<a class="headerlink" href="#Geotiff Layer" title="Permalink to this headline">¶</a></h1>
<div class="block">Renders a GeoTIFF image as layer.
<p>Type: <code>geotiff</code></p></div>
<h3>Inputs</h3>
<dl>
<dt><code>failOnError</code> </dt>
<dd><div class="block">Fail if a tile return an error.</div></dd>
</dl>
<dl>
<dt><code>name</code> </dt>
<dd><div class="block">The name of the layer.</div></dd>
</dl>
<dl>
<dt><code>opacity</code> </dt>
<dd><div class="block">The opacity of the image.</div></dd>
</dl>
<dl>
<dt><code>style</code> </dt>
<dd><div class="block">A string identifying a style to use when rendering the raster.</div></dd>
</dl>
<dl>
<dt><code>url</code> required</dt>
<dd><div class="block">The url of the geotiff. It can be a file but if it is the file must be contained within the
config directory.</div></dd>
</dl>
</div>
<div class="section" id="Gml Layer">
<h1>Gml Layer<a class="headerlink" href="#Gml Layer" title="Permalink to this headline">¶</a></h1>
<div class="block">Renders GML layers.
<p>Type: <code>gml</code></p></div>
<h3>Configuration</h3>
<dl>
<dt><code>parser</code> </dt>
<dd></dd>
</dl>
<h3>Inputs</h3>
<dl>
<dt><code>failOnError</code> </dt>
<dd><div class="block">Fail if a tile return an error.</div></dd>
</dl>
<dl>
<dt><code>name</code> </dt>
<dd><div class="block">The name of the layer.</div></dd>
</dl>
<dl>
<dt><code>opacity</code> </dt>
<dd><div class="block">The opacity of the image.</div></dd>
</dl>
<dl>
<dt><code>renderAsSvg</code> </dt>
<dd><div class="block">Indicates if the layer is rendered as SVG.
<p>(will default to <code>Configuration.defaultToSvg</code>).</p></div></dd>
</dl>
<dl>
<dt><code>style</code> </dt>
<dd><div class="block">The style name of a style to apply to the features during rendering. The style name must map to
a style in the template or the configuration objects.
<p>If no style is defined then the default style for the geometry type will be used.</p></div></dd>
</dl>
<dl>
<dt><code>url</code> required</dt>
<dd><div class="block">A url to the gml or the raw Gml data.
<p>The url can be a file url, however if it is it must be relative to the configuration
directory.</p></div></dd>
</dl>
</div>
<div class="section" id="Grid Layer">
<h1>Grid Layer<a class="headerlink" href="#Grid Layer" title="Permalink to this headline">¶</a></h1>
<div class="block">A layer which is a spatial grid of lines on the map.
<p>Type: <code>grid</code> </p></div>
<div class="admonition note examples">
<p class="first admonition-title">Example</p>
<p class="last">
<a
href="https://github.com/mapfish/mapfish-print/tree/master/examples/src/test/resources/examples/crosses_point_grid"
target="_blank"
class="fa fa-book"
> crosses_point_grid</a
>
</p>
</div>
<h3>Configuration</h3>
<dl>
<dt><code>parser</code> </dt>
<dd></dd>
</dl>
<h3>Inputs</h3>
<dl>
<dt><code>failOnError</code> </dt>
<dd><div class="block">Fail if a tile return an error.</div></dd>
</dl>
<dl>
<dt><code>font</code> </dt>
<dd><div class="block">Configuration for the font of the grid labels. The default is the default system font.</div></dd>
</dl>
<dl>
<dt><code>formatDecimalSeparator</code> </dt>
<dd><div class="block">The character used to separate the decimal part (for example ","). This parameter is only used
if <code>valueFormat</code> is used. The default is the character of the default locale.</div></dd>
</dl>
<dl>
<dt><code>formatGroupingSeparator</code> </dt>
<dd><div class="block">The character used for the thousands separator (for example "'"). This parameter is only used
if <code>valueFormat</code> is used. The default is the character of the default locale.</div></dd>
</dl>
<dl>
<dt><code>gridColor</code> </dt>
<dd><div class="block">The color of the grid points or lines. Default is gray (<a shape="rect" href="#DEFAULT_GRID_COLOR">"gray"</a>)</div></dd>
</dl>
<dl>
<dt><code>gridType</code> </dt>
<dd><div class="block">The type of grid to render.
<p>Can be LINES or POINTS. Default is LINES.</p></div></dd>
</dl>
<dl>
<dt><code>haloColor</code> </dt>
<dd><div class="block">The color of the halo around grid label text. The color is defined the same as colors in CSS.
Default is white (<a shape="rect" href="#DEFAULT_HALO_COLOR">"#FFF"</a>)</div></dd>
</dl>
<dl>
<dt><code>haloRadius</code> </dt>
<dd><div class="block">The size of the halo around the Grid Labels. The default is <a shape="rect" href="#DEFAULT_HALO_RADIUS">1</a>.</div></dd>
</dl>
<dl>
<dt><code>horizontalYOffset</code> </dt>
<dd><div class="block">Apply an Y offset to horizontal grid line labels, relative to the horizontal grid lines.
Defaults to 0.</div></dd>
</dl>
<dl>
<dt><code>indent</code> </dt>
<dd><div class="block">The number of pixels to indent the grid labels from the end of the map. The default is <a shape="rect" href="#DEFAULT_INDENT">5</a>.</div></dd>
</dl>
<dl>
<dt><code>labelColor</code> </dt>
<dd><div class="block">The color of the grid label text. Default is dark gray (<a shape="rect" href="#DEFAULT_LABEL_COLOR">"#444"</a>)</div></dd>
</dl>
<dl>
<dt><code>labelFormat</code> </dt>
<dd><div class="block">The formatting string used to format the label (for example "%1.2f %s"). By default the label
is formatted according to the unit and label value. For the format syntax, see <a shape="rect" href="https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html">java.util.Formatter</a>.
If <code>labelFormat</code> is set, <code>valueFormat</code>, <code>unitFormat</code> and
custom separator characters will be ignored.</div></dd>
</dl>
<dl>
<dt><code>labelProjection</code> </dt>
<dd><div class="block">The projection code to use for the labels. The value should be the string <code>authority:code<br> </code> form identifying the projection. By default it will be the same projection as the map.</div></dd>
</dl>
<dl>
<dt><code>longitudeFirst</code> </dt>
<dd><div class="block">By default the normal axis order as specified in EPSG code will be used when parsing
projections. However the requester can override this by explicitly declaring that longitude
axis is first.</div></dd>
</dl>
<dl>
<dt><code>name</code> </dt>
<dd><div class="block">The name of the layer.</div></dd>
</dl>
<dl>
<dt><code>numberOfLines</code> required</dt>
<dd><div class="block">The x,y number of grid lines.
<p>The x is the number of lines that run vertically along the page.</p></div></dd>
</dl>
<dl>
<dt><code>opacity</code> </dt>
<dd><div class="block">The opacity of the image.</div></dd>
</dl>
<dl>
<dt><code>origin</code> </dt>
<dd><div class="block">The x,y point of grid origin.
<p>This is required if <a shape="rect" href="#spacing"><code>spacing</code></a> is defined.</p></div></dd>
</dl>
<dl>
<dt><code>pointsInLine</code> </dt>
<dd><div class="block">The number of points that will be in the grid line (if the gridType is LINES). If the line will
be curved (for certain projections) then the more points the smoother the curve.
<p>The default number of points is <a shape="rect" href="#DEFAULT_POINTS_IN_GRID_LINE">10000</a>.</p></div></dd>
</dl>
<dl>
<dt><code>renderAsSvg</code> </dt>
<dd><div class="block">Indicates if the layer is rendered as SVG.
<p>(will default to <code>Configuration.defaultToSvg</code>).</p></div></dd>
</dl>
<dl>
<dt><code>rotateLabels</code> </dt>
<dd><div class="block">If true (the default), the labels will be rotated to follow the lines they belong to. Otherwise
they are orientated west to east.</div></dd>
</dl>
<dl>
<dt><code>spacing</code> required</dt>
<dd><div class="block">The x,y spacing between grid lines.
<p>Either <a shape="rect" href="#spacing"><code>spacing</code></a> or <a shape="rect" href="#numberOfLines"><code>numberOfLines</code></a></p><p>If spacing is defined then <a shape="rect" href="#origin"><code>origin</code></a> must also be defined</p></div></dd>
</dl>
<dl>
<dt><code>style</code> </dt>
<dd><div class="block">The style name of a style to apply to the features during rendering. The style name must map to
a style in the template or the configuration objects.
<p>If no style is defined then the default grid style will be used. The default will depend if
the type is point or line and will respect <a shape="rect" href="#gridColor"><code>gridColor</code></a> and <a shape="rect" href="#haloColor"><code>haloColor</code></a> and <a shape="rect" href="#haloRadius"><code>haloRadius</code></a>. If <a shape="rect" href="#gridType"><code>gridType</code></a> is <a shape="rect" href="GridType.html#POINTS"><code>GridType.POINTS</code></a> then the style will be crosses
with a haloRadius sized halo around the cross. If <a shape="rect" href="GridType.html#LINES"><code>GridType.LINES</code></a> then the style will be
a dashed line with no halo.</p></div></dd>
</dl>
<dl>
<dt><code>unitFormat</code> </dt>
<dd><div class="block">The formatting string used to format the unit part of a label (for example " %s"). This
parameter is ignored if <code>labelFormat</code> is set. <code>valueFormat</code> must be set
to use this parameter. For the format syntax, see <a shape="rect" href="https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html">java.util.Formatter</a>.</div></dd>
</dl>
<dl>
<dt><code>valueFormat</code> </dt>
<dd><div class="block">The formatting string used to format the decimal part of a label (for example "###,###"). This
parameter is ignored if <code>labelFormat</code> is set. For the format syntax, see <a shape="rect" href="https://docs.oracle.com/javase/tutorial/i18n/format/decimalFormat.html">DecimalFormat</a>.</div></dd>
</dl>
<dl>
<dt><code>verticalXOffset</code> </dt>
<dd><div class="block">Apply an X offset to the vertical grid line labels, relative to the vertical grid lines.
Defaults to 0.</div></dd>
</dl>
</div>
<div class="section" id="Image Layer">
<h1>Image Layer<a class="headerlink" href="#Image Layer" title="Permalink to this headline">¶</a></h1>
<div class="block">Renders an image as layer.
<p>Type: <code>image</code></p></div>
<h3>Inputs</h3>
<dl>
<dt><code>baseURL</code> required</dt>
<dd><div class="block">The base URL for the image file. Used for making request.</div></dd>
</dl>
<dl>
<dt><code>extent</code> required</dt>
<dd><div class="block">The extent of the image. Used for placing image on map.</div></dd>
</dl>
<dl>
<dt><code>failOnError</code> </dt>
<dd><div class="block">Fail if a tile return an error.</div></dd>
</dl>
<dl>
<dt><code>imageFormat</code> </dt>
<dd><div class="block">The format of the image. for example image/png, image/jpeg, etc...</div></dd>
</dl>
<dl>
<dt><code>name</code> </dt>
<dd><div class="block">The name of the layer.</div></dd>
</dl>
<dl>
<dt><code>opacity</code> </dt>
<dd><div class="block">The opacity of the image.</div></dd>
</dl>
<dl>
<dt><code>style</code> </dt>
<dd><div class="block">The styles to apply to the image.</div></dd>
</dl>
</div>
<div class="section" id="Osm Layer">
<h1>Osm Layer<a class="headerlink" href="#Osm Layer" title="Permalink to this headline">¶</a></h1>
<div class="block">Renders OpenStreetMap or other tiled layers.
<p>Type: <code>osm</code> </p></div>
<div class="admonition note examples">
<p class="first admonition-title">Example</p>
<p class="last">
<a
href="https://github.com/mapfish/mapfish-print/tree/master/examples/src/test/resources/examples/print_osm_new_york_EPSG_3857"
target="_blank"
class="fa fa-book"
> print_osm_new_york_EPSG_3857</a
>
</p>
</div>
<h3>Inputs</h3>
<dl>
<dt><code>baseURL</code> required</dt>
<dd><div class="block">The URL used for the tile requests.
<p>Supported formats:
</p><ul><li>The base part of the URL, for example 'http://tile.openstreetmap.org'. This results in an
URL like 'http://tile.openstreetmap.org/12/123/456.png'.
</li><li>An URL template with the placeholders '{x}', '{y}' or '{-y}', and '{z}'. For example:
'http://tile.openstreetmap.org/{z}/{x}/{y}.png'. <br clear="none"></br>
The placeholder '{-y}' provides support for OSGeo TMS tiles.
</li></ul></div></dd>
</dl>
<dl>
<dt><code>customParams</code> </dt>
<dd><div class="block">Custom query parameters to use when making http requests. <a shape="rect" href="#customParams"><code>customParams</code></a>.
<p>The json should look something like:
</p><div class="highlight"><pre> {<br> "param1Name": "value",<br> "param2Name": ["value1", "value2"]<br> }</pre></div></div></dd>
</dl>
<dl>
<dt><code>dpi</code> </dt>
<dd><div class="block">The DPI of the OSM tiles.</div></dd>
</dl>
<dl>
<dt><code>failOnError</code> </dt>
<dd><div class="block">Fail if a tile return an error.</div></dd>
</dl>
<dl>
<dt><code>imageExtension</code> </dt>
<dd><div class="block">The image extension. for example png, jpeg, etc...</div></dd>
</dl>
<dl>
<dt><code>maxExtent</code> </dt>
<dd><div class="block">The maximum extent of the osm layer. Must have 4 coordinates, minX, minY, maxX, maxY
<p>Default: [-20037508.34, -20037508.34, 20037508.34, 20037508.34]</p></div></dd>
</dl>
<dl>
<dt><code>name</code> </dt>
<dd><div class="block">The name of the layer.</div></dd>
</dl>
<dl>
<dt><code>opacity</code> </dt>
<dd><div class="block">The opacity of the image.</div></dd>
</dl>
<dl>
<dt><code>rasterStyle</code> </dt>
<dd><div class="block">The name of the style (in Configuration or Template) to use when drawing the layer to the map.
This is separate from the style in that it indicates how to draw the map. It allows one to
apply any of the SLD raster styling.</div></dd>
</dl>
<dl>
<dt><code>resolutionTolerance</code> </dt>
<dd><div class="block">The amount of difference between a resolution and a target resolution to consider the two
equal. The value is a value from 0-1.</div></dd>
</dl>
<dl>
<dt><code>resolutions</code> </dt>
<dd><div class="block">The allowed resolutions for this layer.</div></dd>
</dl>
<dl>
<dt><code>tileSize</code> </dt>
<dd><div class="block">The size of each tile. Must have 2 values: width, height
<p>Default: [256, 256]</p></div></dd>
</dl>
</div>
<div class="section" id="Tiled Wms Layer">
<h1>Tiled Wms Layer<a class="headerlink" href="#Tiled Wms Layer" title="Permalink to this headline">¶</a></h1>
<div class="block">Renders tiled WMS layers.
<p>Type: <code>tiledwms</code> </p></div>
<div class="admonition note examples">
<p class="first admonition-title">Example</p>
<p class="last">
<a
href="https://github.com/mapfish/mapfish-print/tree/master/examples/src/test/resources/examples/printtiledwms"
target="_blank"
class="fa fa-book"
> printtiledwms</a
>
</p>
</div>
<h3>Inputs</h3>
<dl>
<dt><code>baseURL</code> required</dt>
<dd><div class="block">The base URL for the WMS. Used for making WMS requests.</div></dd>
</dl>
<dl>
<dt><code>customParams</code> </dt>
<dd><div class="block">Custom query parameters to use when making http requests. These are related to <a shape="rect" href="#mergeableParams"><code>mergeableParams</code></a> except they are the parameters that will prevent two layers from the same
server from being merged into a single request with both layers. See <a shape="rect" href="#mergeableParams"><code>mergeableParams</code></a>
for a more detailed example of the difference between <a shape="rect" href="#mergeableParams"><code>mergeableParams</code></a> and <a shape="rect" href="#customParams"><code>customParams</code></a>.
<p>The json should look something like:
</p><div class="highlight"><pre> {<br> "param1Name": "value",<br> "param2Name": ["value1", "value2"]<br> }</pre></div></div></dd>
</dl>
<dl>
<dt><code>failOnError</code> </dt>
<dd><div class="block">Fail if a tile return an error.</div></dd>
</dl>
<dl>
<dt><code>imageFormat</code> </dt>
<dd><div class="block">The format of the image. for example image/png, image/jpeg, etc...</div></dd>
</dl>
<dl>
<dt><code>layers</code> required</dt>
<dd><div class="block">The wms layer to request in the GetMap request. The order is important. It is the order that
they will appear in the request.
<p>As with the WMS specification, the first layer will be the first layer drawn on the map (the
bottom/base layer) of the map. This means that layer at position 0 in the array will covered by
layer 1 (where not transparent) and so on.</p></div></dd>
</dl>
<dl>
<dt><code>mergeableParams</code> </dt>
<dd><div class="block">Custom query parameters that can be merged if multiple layers are merged together into a single
request.
<p>The json should look something like:
</p><div class="highlight"><pre> {<br> "param1Name": "value",<br> "param2Name": ["value1", "value2"]<br> }</pre></div>
For example in WMS the style parameter can be merged. If there are several wms layers that can
be merged except they have different style parameters they can be merged because the style
parameter can be merged.
<p>Compare that to DPI parameter (for QGIS wms mapserver). if two layers have different DPI
then the layers cannot be merged. In this case the DPI should <em>NOT</em> be one of the <a shape="rect" href="#mergeableParams"><code>mergeableParams</code></a> it should be one of the <a shape="rect" href="#customParams"><code>customParams</code></a>.</p></div></dd>
</dl>
<dl>
<dt><code>method</code> </dt>
<dd><div class="block">The HTTP verb to use for fetching the images. Can be either "GET" (the default) or "POST".
<p>In case of "POST", the parameters are send in the body of the request using an
"application/x-www-form-urlencoded" content type. This can be used when the parameters are too
long. Tested only with GeoServer.</p></div></dd>
</dl>
<dl>
<dt><code>name</code> </dt>
<dd><div class="block">The name of the layer.</div></dd>
</dl>
<dl>
<dt><code>opacity</code> </dt>
<dd><div class="block">The opacity of the image.</div></dd>
</dl>
<dl>
<dt><code>rasterStyle</code> </dt>
<dd><div class="block">The name of the style (in Configuration or Template) to use when drawing the layer to the map.
This is separate from the style in that it indicates how to draw the map. It allows one to
apply any of the SLD raster styling.</div></dd>
</dl>
<dl>
<dt><code>serverType</code> </dt>
<dd><div class="block">The server type ("mapserver", "geoserver" or "qgisserver"). By specifying the server type
vendor specific parameters (like for the DPI value) can be used when making the request.</div></dd>
</dl>
<dl>
<dt><code>styles</code> </dt>
<dd><div class="block">The styles to apply to the layers. If this is defined there should be the same number as the
layers and the style are applied to the layer in the <a shape="rect" href="#layers"><code>layers</code></a> field.</div></dd>
</dl>
<dl>
<dt><code>tileBufferSize</code> </dt>
<dd><div class="block">A two element array of integers indicating the width and height tile buffer.</div></dd>
</dl>
<dl>
<dt><code>tileSize</code> required</dt>
<dd><div class="block">A two element array of integers indicating the x and y size of each tile.</div></dd>
</dl>
<dl>
<dt><code>useNativeAngle</code> </dt>
<dd><div class="block">If true transform the map angle to customParams.angle for GeoServer, and MapServer.</div></dd>
</dl>
<dl>
<dt><code>version</code> </dt>
<dd><div class="block">The WMS version to use when making requests.</div></dd>
</dl>
</div>
<div class="section" id="WMTS Layer">
<h1>WMTS Layer<a class="headerlink" href="#WMTS Layer" title="Permalink to this headline">¶</a></h1>
<div class="block">Renders WMTS layers.
<p>Type: <code>wmts</code> </p></div>
<div class="admonition note examples">
<p class="first admonition-title">Example</p>
<p class="last">
<a
href="https://github.com/mapfish/mapfish-print/tree/master/examples/src/test/resources/examples/printwmts_tyger_ny_EPSG_3857"
target="_blank"
class="fa fa-book"
> printwmts_tyger_ny_EPSG_3857</a
>
</p>
</div>
<h3>Inputs</h3>
<dl>
<dt><code>baseURL</code> required</dt>
<dd><div class="block">The ‘ResourceURL’ available in the WMTS capabilities.
<p>Example (for <code>requestEncoding: "KVP"</code>):
</p><div class="highlight"><pre> baseUrl: "http://domain.com/wmts"</pre></div>
Example (for <code>requestEncoding: "REST"</code>):
<div class="highlight"><pre> baseUrl: "http://domain.com/wmts/roads/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.png"</pre></div>
The following URL template variables are replaced:
<ul><li>{Layer}
</li><li>{style}
</li><li>{TileMatrixSet}
</li><li>{TileMatrix}
</li><li>{TileRow}
</li><li>{TileCol}
</li><li>{[DIMENSION.IDENTIFIER]}
</li></ul></div></dd>
</dl>
<dl>
<dt><code>customParams</code> </dt>
<dd><div class="block">Custom query parameters to use when making http requests. These are related to <a shape="rect" href="#mergeableParams"><code>mergeableParams</code></a> except they are the parameters that will prevent two layers from the same
server from being merged into a single request with both layers. See <a shape="rect" href="#mergeableParams"><code>mergeableParams</code></a>
for a more detailed example of the difference between <a shape="rect" href="#mergeableParams"><code>mergeableParams</code></a> and <a shape="rect" href="#customParams"><code>customParams</code></a>.
<p>The json should look something like:
</p><div class="highlight"><pre> {<br> "param1Name": "value",<br> "param2Name": ["value1", "value2"]<br> }</pre></div></div></dd>
</dl>
<dl>
<dt><code>dimensionParams</code> </dt>
<dd><div class="block">Dictionary of dimensions name (Must be uppercase) => value.</div></dd>
</dl>
<dl>
<dt><code>dimensions</code> </dt>
<dd><div class="block">The "sample" dimensions or image color bands to retrieve.
<p>This can be null, if so then the default dimensions will be returned. If specified they must
be dimensions supported by the server.
</p><p>These are keys to the <a shape="rect" href="#dimensionParams"><code>dimensionParams</code></a>.</p></div></dd>
</dl>
<dl>
<dt><code>failOnError</code> </dt>
<dd><div class="block">Fail if a tile return an error.</div></dd>
</dl>
<dl>
<dt><code>imageFormat</code> </dt>
<dd><div class="block">The format of the image. for example image/png, image/jpeg, etc...</div></dd>
</dl>
<dl>
<dt><code>layer</code> required</dt>
<dd><div class="block">The layer name.</div></dd>
</dl>
<dl>
<dt><code>matrices</code> required</dt>
<dd><div class="block">Array of matrix ids.
<p>Example:
</p><div class="highlight"><pre> [{<br> "identifier": "0",<br> "matrixSize": [1, 1],<br> "scaleDenominator": 4000,<br> "tileSize": [256, 256],<br> "topLeftCorner": [420000, 350000]<br> }, ...]</pre></div></div></dd>
</dl>
<dl>
<dt><code>matrixSet</code> required</dt>
<dd><div class="block">Reference/Identifier to a tileMatrixSet and limits.</div></dd>
</dl>
<dl>
<dt><code>mergeableParams</code> </dt>
<dd><div class="block">Custom query parameters that can be merged if multiple layers are merged together into a single
request.
<p>The json should look something like:
</p><div class="highlight"><pre> {<br> "param1Name": "value",<br> "param2Name": ["value1", "value2"]<br> }</pre></div>
For example in WMS the style parameter can be merged. If there are several wms layers that can
be merged except they have different style parameters they can be merged because the style
parameter can be merged.
<p>Compare that to DPI parameter (for QGIS wms mapserver). if two layers have different DPI
then the layers cannot be merged. In this case the DPI should <em>NOT</em> be one of the <a shape="rect" href="#mergeableParams"><code>mergeableParams</code></a> it should be one of the <a shape="rect" href="#customParams"><code>customParams</code></a>.</p></div></dd>
</dl>
<dl>
<dt><code>name</code> </dt>
<dd><div class="block">The name of the layer.</div></dd>
</dl>
<dl>
<dt><code>opacity</code> </dt>
<dd><div class="block">The opacity of the image.</div></dd>
</dl>
<dl>
<dt><code>rasterStyle</code> </dt>
<dd><div class="block">The name of the style (in Configuration or Template) to use when drawing the layer to the map.
This is separate from the style in that it indicates how to draw the map. It allows one to
apply any of the SLD raster styling.</div></dd>
</dl>
<dl>
<dt><code>requestEncoding</code> </dt>
<dd><div class="block">The way to make the requests. Either <code>KVP</code> or <code>REST</code> (default).</div></dd>
</dl>
<dl>
<dt><code>style</code> </dt>
<dd><div class="block">The style name (for styles on the WMTS server).</div></dd>
</dl>
<dl>
<dt><code>version</code> </dt>
<dd><div class="block">The WMTS protocol version to use.</div></dd>
</dl>
</div>
<div class="section" id="Wms Layer">
<h1>Wms Layer<a class="headerlink" href="#Wms Layer" title="Permalink to this headline">¶</a></h1>
<div class="block">Renders WMS layers as single image.
<p>Type: <code>wms</code>
</p></div>
<div class="admonition note examples">
<p class="first admonition-title">Example</p>
<p class="last">
<a
href="https://github.com/mapfish/mapfish-print/tree/master/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857"
target="_blank"
class="fa fa-book"
> printwms_tyger_ny_EPSG_3857</a
> <a
href="https://github.com/mapfish/mapfish-print/tree/master/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326"
target="_blank"
class="fa fa-book"
> printwms_UsaPopulation_EPSG_4326</a
>
</p>
</div>
<h3>Inputs</h3>
<dl>
<dt><code>baseURL</code> required</dt>
<dd><div class="block">The base URL for the WMS. Used for making WMS requests.</div></dd>
</dl>