-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.html
More file actions
95 lines (85 loc) · 3.17 KB
/
dev.html
File metadata and controls
95 lines (85 loc) · 3.17 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
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
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Waymark JS (Dev)</title>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<!-- Libs CSS -->
<link rel="stylesheet" href="libs/css/leaflet.min.css" />
<link rel="stylesheet" href="libs/css/font-awesome.min.css" />
<link rel="stylesheet" href="libs/css/ionicons.min.css" />
<link rel="stylesheet" href="libs/css/Control.Geocoder.css" />
<link rel="stylesheet" href="libs/css/L.Control.Locate.min.css" />
<link rel="stylesheet" href="libs/css/leaflet-elevation.css" />
<link rel="stylesheet" href="libs/css/leaflet.fullscreen.min.css" />
<!-- Source Less (Vite compiles this on the fly) -->
<link rel="stylesheet" href="src/less/Waymark_Map.less" />
<link rel="stylesheet" href="src/less/Waymark_Map_Viewer.less" />
<link rel="stylesheet" href="src/less/Waymark_Map_Editor.less" />
<!-- Libs JS -->
<script src="libs/js/leaflet.min.js"></script>
<script>
// Restore L for plugins (since Waymark's Leaflet uses noConflict)
if (window.Waymark_L) {
window.L = window.Waymark_L;
}
</script>
<script src="libs/js/L.Control.Locate.min.js"></script>
<script src="libs/js/Control.Geocoder.js"></script>
<script src="libs/js/leaflet.fullscreen.min.js"></script>
<script src="libs/js/leaflet.markercluster.js"></script>
<script src="libs/js/leaflet.polylineDecorator.js"></script>
<script src="libs/js/Leaflet.Editable.js"></script>
<script src="libs/js/Leaflet.FeatureGroup.SubGroup.js"></script>
<script src="libs/js/Leaflet.Sleep.js"></script>
<script src="libs/js/leaflet-elevation.js"></script>
<script src="libs/js/togeojson.min.js"></script>
<script src="libs/js/togpx.js"></script>
<script src="libs/js/tokml.js"></script>
<!-- Source JS -->
<script src="src/js/Waymark_Map.js"></script>
<script src="src/js/Waymark_Map_Viewer.js"></script>
<script src="src/js/Waymark_Map_Editor.js"></script>
<script src="src/js/Waymark_Map_Factory.js"></script>
<style>
body {
margin: 0;
padding: 0;
height: 100%;
display: flex;
}
#waymark-data,
#waymark-map {
}
#waymark-map {
flex: 2;
}
#waymark-data {
flex: 1;
}
</style>
</head>
<body>
<div id="waymark-map" class="waymark-map"></div>
<textarea id="waymark-data"></textarea>
<script>
// Set body height to be 100% of the viewport
jQuery("body").height($(window).height());
let waymark_instance = window.Waymark_Map_Factory.editor();
const _configUrl = "docs/public/examples/assets/config/route.json";
const _dataUrl = "docs/public/examples/assets/geo/route.geojson";
Promise.all([
fetch(_configUrl).then((r) => r.json()),
fetch(_dataUrl).then((r) => r.json()),
])
.then(([cfg, geo]) => {
waymark_instance.init(cfg);
waymark_instance.load_json(geo);
})
.catch((err) => {
console.error(err);
});
</script>
</body>
</html>