Skip to content

Commit 9cb57e2

Browse files
authored
Merge pull request #149 from terrestris/support-v3
MapFish Print 3 support
2 parents 0a1fd17 + d2719a2 commit 9cb57e2

40 files changed

+2953
-196
lines changed

.babelrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ printManager.init()
6767
| maskColor | String | No | `rgba(130, 130, 130, 0.5)` | The color to apply to the mask around the extent feature. Will be applied to the default extentLayer only. If you don't want the mask to be shown on the map, provide a custom extentLayer.|
6868
| transformOpts | Object | No | `{}` | Custom options to apply to the transform interaction. See http://viglino.github.io/ol-ext/doc/doc-pages/ol.interaction.Transform.html for valid options.|
6969
| layerFilter | Function | No | `() => true` |A filter function that will be called before the print call. Should return a Boolean whether to serialize a layer for print or not.|
70-
| serializers | Array | No | `[WMSSerializer, VectorSerializer]` |The layer serializers to use. May be overridden or extented to obtain custom functionality.|
70+
| serializers | Array | No | `[MapFishPrintV2WMSSerializer, VectorSerializer]` |The layer serializers to use. May be overridden or extented to obtain custom functionality.|
7171

7272
### Methods
7373

assets/v3/apps.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"default",
3+
"simple"
4+
]

assets/v3/capabilities.json

Lines changed: 309 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,309 @@
1+
{
2+
"app": "default",
3+
"layouts": [{
4+
"name": "A4 Portrait",
5+
"attributes": [{
6+
"name": "map",
7+
"type": "MapAttributeValues",
8+
"clientParams": {
9+
"zoomToFeatures": {
10+
"type": "ZoomToFeatures",
11+
"embeddedType": {
12+
"minScale": {
13+
"type": "double",
14+
"default": null
15+
},
16+
"zoomType": {
17+
"type": "ZoomType",
18+
"embeddedType": {},
19+
"default": "EXTENT"
20+
},
21+
"layer": {
22+
"type": "String",
23+
"default": null
24+
},
25+
"minMargin": {
26+
"type": "int",
27+
"default": 10
28+
}
29+
}
30+
},
31+
"dpi": {
32+
"type": "double"
33+
},
34+
"bbox": {
35+
"type": "double",
36+
"isArray": true
37+
},
38+
"center": {
39+
"type": "double",
40+
"isArray": true
41+
},
42+
"width": {
43+
"type": "int",
44+
"default": 553
45+
},
46+
"longitudeFirst": {
47+
"type": "boolean",
48+
"default": null
49+
},
50+
"layers": {
51+
"type": "array",
52+
"default": []
53+
},
54+
"projection": {
55+
"type": "String",
56+
"default": null
57+
},
58+
"useNearestScale": {
59+
"type": "boolean",
60+
"default": null
61+
},
62+
"dpiSensitiveStyle": {
63+
"type": "boolean",
64+
"default": true
65+
},
66+
"scale": {
67+
"type": "double",
68+
"default": null
69+
},
70+
"useAdjustBounds": {
71+
"type": "boolean",
72+
"default": null
73+
},
74+
"height": {
75+
"type": "int",
76+
"default": 555
77+
},
78+
"areaOfInterest": {
79+
"type": "AreaOfInterest",
80+
"embeddedType": {
81+
"area": {
82+
"type": "String"
83+
},
84+
"display": {
85+
"type": "AoiDisplay",
86+
"embeddedType": {},
87+
"default": "RENDER"
88+
},
89+
"style": {
90+
"type": "String",
91+
"default": null
92+
},
93+
"renderAsSvg": {
94+
"type": "boolean",
95+
"default": null
96+
}
97+
},
98+
"default": null
99+
},
100+
"rotation": {
101+
"type": "double",
102+
"default": null
103+
}
104+
},
105+
"clientInfo": {
106+
"dpiSuggestions": [72, 120, 200, 254],
107+
"maxDPI": 254,
108+
"width": 553,
109+
"height": 555
110+
}
111+
}, {
112+
"name": "legend",
113+
"type": "LegendAttributeValue",
114+
"clientParams": {
115+
"classes": {
116+
"type": "LegendAttributeValue[]",
117+
"embeddedType": {
118+
"classes": {
119+
"type": "recursiveDefinition",
120+
"default": null,
121+
"isArray": true
122+
},
123+
"dpi": {
124+
"type": "double",
125+
"default": null
126+
},
127+
"icons": {
128+
"type": "URL",
129+
"default": null,
130+
"isArray": true
131+
},
132+
"name": {
133+
"type": "String",
134+
"default": null
135+
}
136+
},
137+
"default": null,
138+
"isArray": true
139+
},
140+
"dpi": {
141+
"type": "double",
142+
"default": null
143+
},
144+
"icons": {
145+
"type": "URL",
146+
"default": null,
147+
"isArray": true
148+
},
149+
"name": {
150+
"type": "String",
151+
"default": null
152+
}
153+
}
154+
}]
155+
}, {
156+
"name": "A4 landscape",
157+
"attributes": [{
158+
"name": "map",
159+
"type": "MapAttributeValues",
160+
"clientParams": {
161+
"zoomToFeatures": {
162+
"type": "ZoomToFeatures",
163+
"embeddedType": {
164+
"minScale": {
165+
"type": "double",
166+
"default": null
167+
},
168+
"zoomType": {
169+
"type": "ZoomType",
170+
"embeddedType": {},
171+
"default": "EXTENT"
172+
},
173+
"layer": {
174+
"type": "String",
175+
"default": null
176+
},
177+
"minMargin": {
178+
"type": "int",
179+
"default": 10
180+
}
181+
}
182+
},
183+
"dpi": {
184+
"type": "double"
185+
},
186+
"bbox": {
187+
"type": "double",
188+
"isArray": true
189+
},
190+
"center": {
191+
"type": "double",
192+
"isArray": true
193+
},
194+
"width": {
195+
"type": "int",
196+
"default": 800
197+
},
198+
"longitudeFirst": {
199+
"type": "boolean",
200+
"default": null
201+
},
202+
"layers": {
203+
"type": "array",
204+
"default": []
205+
},
206+
"projection": {
207+
"type": "String",
208+
"default": null
209+
},
210+
"useNearestScale": {
211+
"type": "boolean",
212+
"default": null
213+
},
214+
"dpiSensitiveStyle": {
215+
"type": "boolean",
216+
"default": true
217+
},
218+
"scale": {
219+
"type": "double",
220+
"default": null
221+
},
222+
"useAdjustBounds": {
223+
"type": "boolean",
224+
"default": null
225+
},
226+
"height": {
227+
"type": "int",
228+
"default": 553
229+
},
230+
"areaOfInterest": {
231+
"type": "AreaOfInterest",
232+
"embeddedType": {
233+
"area": {
234+
"type": "String"
235+
},
236+
"display": {
237+
"type": "AoiDisplay",
238+
"embeddedType": {},
239+
"default": "RENDER"
240+
},
241+
"style": {
242+
"type": "String",
243+
"default": null
244+
},
245+
"renderAsSvg": {
246+
"type": "boolean",
247+
"default": null
248+
}
249+
},
250+
"default": null
251+
},
252+
"rotation": {
253+
"type": "double",
254+
"default": null
255+
}
256+
},
257+
"clientInfo": {
258+
"dpiSuggestions": [72, 120, 200, 254],
259+
"maxDPI": 254,
260+
"width": 800,
261+
"height": 553
262+
}
263+
}, {
264+
"name": "legend",
265+
"type": "LegendAttributeValue",
266+
"clientParams": {
267+
"classes": {
268+
"type": "LegendAttributeValue[]",
269+
"embeddedType": {
270+
"classes": {
271+
"type": "recursiveDefinition",
272+
"default": null,
273+
"isArray": true
274+
},
275+
"dpi": {
276+
"type": "double",
277+
"default": null
278+
},
279+
"icons": {
280+
"type": "URL",
281+
"default": null,
282+
"isArray": true
283+
},
284+
"name": {
285+
"type": "String",
286+
"default": null
287+
}
288+
},
289+
"default": null,
290+
"isArray": true
291+
},
292+
"dpi": {
293+
"type": "double",
294+
"default": null
295+
},
296+
"icons": {
297+
"type": "URL",
298+
"default": null,
299+
"isArray": true
300+
},
301+
"name": {
302+
"type": "String",
303+
"default": null
304+
}
305+
}
306+
}]
307+
}],
308+
"formats": ["jpeg", "jpg", "pdf", "png"]
309+
}

babel.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports =
2+
{
3+
'presets': [
4+
'@babel/preset-env'
5+
],
6+
'plugins': [
7+
'@babel/plugin-syntax-dynamic-import',
8+
'@babel/plugin-proposal-class-properties'
9+
]
10+
};

docker/docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '3'
2+
services:
3+
mapfish-print-manager:
4+
build:
5+
context: mapfish-print-manager/
6+
ports:
7+
- 18082:8080
8+
volumes:
9+
- ./mapfish-print-manager/print-apps:/usr/local/tomcat/webapps/ROOT/print-apps:Z
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM camptocamp/mapfish_print:3.16.1
2+
3+
ENV JAVA_OPTS="-Dfile.encoding=UTF-8 -Duser.timezone=UTC -Xmx512M"
4+
5+
CMD [ "catalina.sh", "run" ]

0 commit comments

Comments
 (0)