-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.html
66 lines (61 loc) · 2.23 KB
/
map.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Schwingbach Reality World Track Points Overview</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ=="
crossorigin=""/>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" ></script>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-A7vV8IFfih/D732iSSKi20u/ooOfj/AGehOKq0f4vLT1Zr2Y+RX7C+w8A1gaSasGtRUZpF/NZgzSAu4/Gc41Lg=="
crossorigin="">
</script>
<script>
function add_markers($nodes) {
$.ajax({
dataType: "json",
type:"GET",
url: "http://fb09-pasig.umwelt.uni-giessen.de/sbapp/Poidata.json",
success: function(data)
{
for(var obj in data)
{
var marker = L.marker([data[obj]['lat'], data[obj]['lon']], title=data[obj]['name']);
marker.addTo(map).bindPopup(data[obj]["comment"]);
}
}
});
}
function init_the_map() {
map = new L.map('mapid');
// url of the basemap - need to change to own basemap
var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
var osm = new L.TileLayer(osmUrl, {minZoom: 8, maxZoom: 17, attribution: osmAttrib});
// Add the basemap
map.addLayer(osm);
add_markers($('osmmap point'));
// start the map in Hessen
map.setView([50.49, 8.53], 13);
}
$(function(){
init_the_map();
});
</script>
<style>
osmmap {
display: block;
height: 700px;
width: 100%;
}
point {
display: none;
}
</style>
</head>
<body>
<code>An overview about all set track points the Schwingbach Reality World App has.</code>
<osmmap id="mapid">
</osmmap>
</body>