Академический Документы
Профессиональный Документы
Культура Документы
From:
Date:
Author(s):
Email:
Version:
Introduction
MapFish Printing is a module within the MapFish (MF) framework. This framework is described on
www.mapfish.org as follows:
MapFish is an easy-to-use and extensible web 2.0 mapping application framework.
MapFish is composed of two parts: MapFish Client and MapFish Server. MapFish Client is a JavaScript
framework based on OpenLayers for the mapping part, on ExtJS and GeoExt for the GUI part. MapFish
Server is responsible for server side treatments and is composed of several modules which can be
implemented in several languages such as Python, Java, Ruby, PHP or others.
MapFish is cartographic server agnostic. It can be used with MapServer, GeoServer, MapGuide or whatever
cartographic server that is able to communicate with open protocols like WMS or WFS.
For the server-side of MapFish there are several implementations, including Java. Although MapFish
provides many mainly GUI (widgets) functions, we will focus here on the MF Printing module, and in
particular its integration with GeoServer.
1. client: sends print spec to MF server URL (see example Appendix 1).
The main parameters in the spec are: map-center, map-scale, layout, dpi. For each map-layer the client
mainly supplies the base URL of each WMS. Also parameters to be substituted are supplied.
2. server: generates PDF and returns unique URL to this PDF
Within the actual processing and rendering the server will construct the WMS URLs for each layer in the
client spec and will fetch the map images from each remote WMS server. The server uses the YAML file
to render the PDF.
3. client: fetches PDF from the returned PDF URL in step 2.
"baseURL":"http://localhost:8080/geoserver/wms?",
"opacity":1,
"singleTile":true,
"customParams":{"TRANSPARENT":true},
"type":"WMS",
"layers":["topp:states"],
"format":"image/png",
"styles":[],
"overview":false
}
],"layout":"A4 portrait"}
#
#
#
#
#
#
#
#
#------------------------------------------------------------------------mainPage:
pageSize: A4
rotation: true
header:
height: 50
items:
- !text
font: Helvetica
fontSize: 30
align: right
text: '${layout}'
items:
- !text
text: '${mapTitle}'
fontSize: 30
spacingAfter: 30
- !map
spacingAfter: 30
width: 440
height: 483
- !columns
# columns can have an absolute position. In that case, they need the 3
following fields:
absoluteX: 410
absoluteY: 310
width: 100
items:
- !scalebar
type: bar
maxSize: 100
barBgColor: white
fontSize: 8
align: right
- !text
text: '${comment}'
spacingAfter: 30
- !attributes
source: data
spacingAfter: 30
columnDefs:
id:
columnWeight: 2
header: !text
text: ID
backgroundColor: #A0A0A0
cell: !text
text: '${id}'
name:
columnWeight: 5
header: !text
text: Name
backgroundColor: #A0A0A0
cell: !columns
config:
cells:
- backgroundColor: '${nameBackgroundColor}'
borderWidth: 1
borderColor: '${nameBorderColor}'
items:
- !text
text: '${name}'
icon:
columnWeight: 2
header: !text
text: Symbol
backgroundColor: #A0A0A0
cell: !image
align: center
maxWidth: 15
maxHeight: 15
url: 'http://www.mapfish.org/svn/mapfish/trunk/MapFish/client/mfbase/
mapfish/img/${icon}.png'
- !text
font: Helvetica
fontSize: 9
align: right
text: '1:${scale} ${now MM.dd.yyyy}'
footer: *commonFooter