-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp2_final_map.html
51 lines (47 loc) · 1.66 KB
/
p2_final_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
<!DOCTYPE html>
<html>
<head>
<title>Eberswalde Leaflet Map</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script
src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js">
</script>
<script src="./fruitTreesEberswalde.js"></script>
<link
rel="stylesheet"
href=" https://unpkg.com/leaflet@1.3.1/dist/leaflet.css "
/>
</head>
<body>
<div id="map" style="width: 80vw; height: 80vh"></div>
</body>
</html>
<script>
var map = L.map('map').setView([52.834502, 13.798697], 13);
mapLink =
'<a href="http://openstreetmap.org">OpenStreetMap</a>';
L.tileLayer(
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© ' + mapLink + ' Contributors',
maxZoom: 18,
}).addTo(map);
L.control.scale().addTo(map);
var style = {
radius: 3,
fillColor: "red",
color: "#fc9272",
weight: 1,
opacity: 1,
fillOpacity: 0.5,
};
for (let i=0; i < fruitTrees.features.length; i++){
tree = L.circleMarker([fruitTrees.features[i].geometry.coordinates[1], fruitTrees.features[i].geometry.coordinates[0]], style)
.addTo(map)
.bindPopup(`This is ${fruitTrees.features[i].properties.Baum_lat} - ${fruitTrees.features[i].properties.Baum_dt} - ${fruitTrees.features[i].properties.Baum_en}
<br><img src="https://raw.githubusercontent.com/OlaMag/Leaflet_exercise_Eberswalde/master/p2_pop-up_image.jpg"
alt="image unavailable" style="width: 10vw; height: 10vh; align:center"></img>
<br><a href=${fruitTrees.features[i].properties.Hyperlink}>See more</a>`
);
}
</script>