-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathnonstd.html
More file actions
40 lines (38 loc) · 1.38 KB
/
nonstd.html
File metadata and controls
40 lines (38 loc) · 1.38 KB
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
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="../dist/lib/leaflet.css" />
<script src="../dist/lib/leaflet.js"></script>
<script src="../src/MapBBCode.js"></script>
<script src="../src/MapBBCodeUI.js"></script>
<script src="../src/controls/FunctionButton.js"></script>
<script src="../src/strings/English.js"></script>
<p>This example tests: non-common bbcode: <map z="11"></map>, working without EditorSprites.js and text handlers, <i>panelHook</i> option.</p>
<div id="test"><map z="11" ll="60,30.1">60,30(OK); 60.01,30.01 60.02,30.015</map></div>
<div id="test2" style="margin-top: 1em;" map=" z="11"">60,30(OK); 60.01,30.01 60.02,30.015</div>
<script>
window.onload = function() {
window.MapBBCodeProcessor.setOptions({
brackets: '<>',
tagParams: true
});
var mapBB = new MapBBCode({
defaultPosition: [59.95, 30.3],
defaultZoom: 13,
panelHook: function(c) {
c.map.addControl(L.functionButtons({ content: 'Edit in JOSM', callback: function() {
var bounds = c.map.getBounds(),
url = 'http://127.0.0.1:8111/load_and_zoom' + L.Util.getParamString({
left: bounds.getWest(),
right: bounds.getEast(),
top: bounds.getNorth(),
bottom: bounds.getSouth()
}),
w = window.open(url);
window.setTimeout(function() { w.close(); }, 1000);
}}, { position: 'topleft' }));
}
});
mapBB.show('test');
mapBB.show('test2');
}
</script>