-
Notifications
You must be signed in to change notification settings - Fork 0
/
pm.html
287 lines (240 loc) · 8.95 KB
/
pm.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Printmaps-OSM webclient</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA=="
crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-nMMmRyTVoLYqjP9hrbed9S+FzjZHW5gY1TWCHA5ckwXZBadntCNs8kEqAWdrb9O7rxbCaA4lKTIWjDXZxflOcA=="
crossorigin=""></script>
<script src="jquery.min.js"></script>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
}
li {
float: left;
}
li a {
display: block;
padding: 8px;
background-color: #dddddd;
}
.content-container {
border: 1px solid #c0c0c0;
margin-top: 0.2em;
margin-bottom: 0.2em;
}
h1 {
font-size: 15pt;
}
h2 {
font-size: 13pt;
}
body {
font-family: sans-serif;
}
#map {
height: 350px;
width: 500px;
}
#navbar {
position: fixed;
top: 0px;
left: 10em;
}
</style>
<script>
var mymap;
$(document).ready(function() {
mymap = L.map('map').setView([51, 9], 13);
L.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
$("#button_order_from_json").on('click', function() {
var j = JSON.parse($("#mapjson").val());
if (j == undefined) {
console.log("JSON not valid!");
} else {
order_from_json(j);
}
}); // end on click button_order_from_json
}); // end document ready
var get_state_for_id = function(id) {
console.log("called: get_state_for_id(" + id + ")");
}
var order_from_json = function(json) {
console.log("called: order_from_json(...) with a valid JSON");
}
</script>
</head>
<body>
<ul id="navbar">
<li class="nav-elem"><a href="#ueberblick" id="nav-ueberblick">Überblick</a></li>
<li class="nav-elem"><a href="#daten" id="nav-daten">Daten</a></li>
<li class="nav-elem"><a href="#karte" id="nav-karte">Karte</a></li>
<li class="nav-elem"><a href="#aktion" id="nav-aktion">Aktion</a></li>
<li class="nav-elem"><a href="#hilfe" id="nav-hilfe">Hilfe</a></li>
<li class="nav-elem"><a href="#impressum" id="nav-impressum">Impressum</a></li>
</ul>
<div class="content-container" id="container-ueberblick">
<a name="ueberblick"/>
<h1>Überblick</h1>
Dies ist der Webclient für printmaps. Siehe <a href="https://github.com/printmaps/printmaps/">https://github.com/printmaps/printmaps/</a>
</div>
<div class="content-container" id="container-daten">
<a name="daten"/>
<h1>Daten</h1>
<h2>YAML</h2>
<textarea name="mapyaml" id="text-map-yaml" rows="20" cols="163"># map definition file
# -------------------
# - do not use tabs or unnecessary white spaces
# - see also http://mapnik.org/mapnik-reference
#
# purpose : figure ground plan (schwarzplan)
# author : kto
# release : 1.0 - 2017/05/27
# 1.1 - 2018/05/19 new design
# service configuration
# ---------------------
# URL of webservice
ServiceURL: http://printmaps-osm.de:8181/api/beta/maps/
# proxy configuration (not to be done here)
# - set the environment variable $HTTP_PROXY on your local system
# - e.g. export HTTP_PROXY=http://user:[email protected]:port
# essential map attributes (required)
# -----------------------------------
# file format (e.g. pdf, png)
Fileformat: png
# scale as in "1:10000" (e.g. 10000, 25000)
Scale: 5000
# width and height (millimeter) (e.g. 609.6)
PrintWidth: 841
PrintHeight: 1189
# center coordinates (decimal degrees) (e.g. 51.9506)
Latitude: 51.95778
Longitude: 7.62256
# style / design (osm-carto, osm-carto-mono, osm-carto-ele20, schwarzplan, schwarzplan+, raster10)
# raster10 (no map data): useful for placing / styling the user map elements
# request the service capabilities to get a list of all available map styles
Style: schwarzplan+
# advanced map attributes (optional)
# ----------------------------------
# layers to hide (see service capabilities for possible values)
HideLayers:
# user defined data objects (optional)
# ------------------------------------
# srs: spatial reference system (is always '+init=epsg:4326' for gpx and kml)
# type: type of data source (ogr, shape, gdal, csv)
# layer: data layer to extract (only required for ogr)
UserData:
# user defined map elements (optional)
# ------------------------------------
# well-known-text:
# POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON
# all values are in millimeter (reference X0 Y0: lower left map corner)
# font sets:
# fontset-0: Noto Fonts normal
# fontset-1: Noto Fonts italic
# fontset-2: Noto Fonts bold
UserItems:
# frame
- Style: <PolygonSymbolizer fill='white' fill-opacity='1.0' />
WellKnownText: POLYGON((0.0 200.0, 0.0 1189.0, 841.0 1189.0, 841.0 200.0, 0.0 200.0), (30.0 230.0, 30.0 1159.0, 811.0 1159.0, 811.0 230.0, 30.0 230.0))
# border
- Style: <LineSymbolizer stroke='darkgrey' stroke-width='6' stroke-linecap='square' />
WellKnownText: LINESTRING(30.0 230.0, 30.0 1159.0, 811.0 1159.0, 811.0 230.0, 30.0 230.0)
# background for footer
- Style: <PolygonSymbolizer fill='white' fill-opacity='1.0' />
WellKnownText: POLYGON((0.0 0.0, 0.0 200.0, 841.0 200.0, 841.0 0.0, 0.0 0.0))
# footer
- Style: <TextSymbolizer fontset-name='fontset-2' size='300' fill='darkgrey' allow-overlap='true'>'M Ü N S T E R'</TextSymbolizer>
WellKnownText: POINT(420.5 150.0)
- Style: <TextSymbolizer fontset-name='fontset-2' size='100' fill='darkgrey' allow-overlap='true'>'51° 57\' 38" N / 7° 37\' 34" E'</TextSymbolizer>
WellKnownText: POINT(420.5 75.0)
# copyright
- Style: <TextSymbolizer fontset-name='fontset-2' size='18' fill='darkgrey' orientation='90' allow-overlap='true'>'© OpenStreetMap contributors'</TextSymbolizer>
WellKnownText: POINT(15 694.5)
# user defined scalebar (optional)
# --------------------------------
# nature length in meter
# X and Y in millimeter
UserScalebar:
# user files to upload
# --------------------
UserFiles:
</textarea>
<h2>JSON</h2>
<textarea id="mapjson" rows="25" cols="195">{
"Data": {
"Type": "maps",
"ID": "",
"Attributes": {
"Fileformat": "png",
"Scale": 5000,
"PrintWidth": 600,
"PrintHeight": 600,
"Latitude": 51.95778,
"Longitude": 7.62256,
"Style": "osm-carto",
"Projection": "3857",
"HideLayers": "admin-low-zoom,admin-mid-zoom,admin-high-zoom,admin-text",
"UserObjects": [
{
"Style": "<PolygonSymbolizer fill='white' fill-opacity='1.0' />",
"WellKnownText": "POLYGON((0.0 0.0, 0.0 600.0, 600.0 600.0, 600.0 0.0, 0.0 0.0), (20.0 20.0, 20.0 580.0, 580.0 580.0, 580.0 20.0, 20.0 20.0))"
},
{
"Style": "<LineSymbolizer stroke='dimgray' stroke-width='1.0' stroke-linecap='square' />",
"WellKnownText": "LINESTRING(20.0 20.0, 20.0 580.0, 580.0 580.0, 580.0 20.0, 20.0 20.0)"
},
{
"Style": "<LineSymbolizer stroke='dimgray' stroke-width='1.5' stroke-linecap='square' />",
"WellKnownText": "MULTILINESTRING((5.0 0.0, 0.0 0.0, 0.0 5.0), (5.0 600.0, 0.0 600.0, 0.0 595.0), (595.0 600.0, 600.0 600.0, 600.0 595.0), (595.0 0.0, 600.0 0.0, 600.0 5.0))"
},
{
"Style": "<TextSymbolizer fontset-name='fontset-2' size='80' fill='dimgray' opacity='0.6' allow-overlap='true'>'Münster'</TextSymbolizer>",
"WellKnownText": "POINT(90.0 560.0)"
},
{
"Style": "<TextSymbolizer fontset-name='fontset-0' size='12' fill='dimgray' orientation='90' allow-overlap='true'>'© OpenStreetMap contributors'</TextSymbolizer>",
"WellKnownText": "POINT(11 300.0)"
}
]
}
}
}
</textarea>
</div>
<div class="content-container" id="container-karte">
<a name="karte"/>
<h1>Karte</h1>
<div id="map"/>
</div>
<div class="content-container" id="container-aktion">
<a name="aktion"/>
<h1>Aktion</h1>
<h2>Karte bestellen (order)</h2>
<input type="button" id="button_order_from_json" value="Karte aus JSON bestellen"/>
<h2>Status/Download</h2>
Map id: <input type="text" id="map_id" size="37"><br/>
<input type="button" id="button_get_state_for_id" value="Status abfragen"/> -
<input type="button" id="button_download_map_for_id" value="Karte herunterladen"/></h2>
</div>
<div class="content-container" id="container-hilfe">
<a name="hilfe"/>
<h1>Hilfe</h1>
Später mal
</div>
<div class="content-container" id="container-impressum">
<a name="impressum"/>
<h1>Impressum</h1>
Später mal
</div>
</body>
</html>