forked from shahparth123/bmiit-github-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (51 loc) · 1.57 KB
/
index.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
<html>
<head>
<title>AMTICS Workship</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI=" crossorigin="" />
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" crossorigin=""></script>
<style>
#map {
height: 500px;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
const map = L.map('map').setView([21.1190193, 72.9077824], 10);
const tiles = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
let cities = [
{
name:"dumas"
lat:20.3974,
long:72.8328
},
{
name: "Surat",
lat: 21.1190193,
long: 72.9077824
},
{
name: "Bardoli",
lat: 21.1363602,
long: 73.098641
},
{
name: "Kamrej",
lat: 21.269354,
long: 72.962955
},
];
cities.forEach(city => {
const marker = L.marker([city.lat, city.long]).addTo(map)
.bindPopup(city.name).openPopup();
})
</script>
</body>
</html>