Skip to content

Commit 6d3d40a

Browse files
authored
leaflet-openstreetmap.in
leaflet map with openstreetmap.in tiles
1 parent 0f42281 commit 6d3d40a

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

osm-in.html

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Opensteetmap.in Tiles on Leaflet JS</title>
5+
<meta charset="utf-8" />
6+
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" />
7+
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
8+
<style>
9+
#map {
10+
height: 100vh;
11+
width: 100%;
12+
}
13+
body {
14+
margin: 0px;
15+
}
16+
</style>
17+
</head>
18+
<body>
19+
20+
<div id="map"></div>
21+
22+
23+
<script>
24+
25+
var osmIn = L.tileLayer('https://{s}.tiles.mapbox.com/v4/openstreetmap.1b68f018/{z}/{x}/{y}.png?access_token=pk.eyJ1Ijoib3NtLWluIiwiYSI6ImNqcnVxMTNrNTJwbHc0M250anUyOW81MjgifQ.cZnvZEyWT5AzNeO3ajg5tg', {attribution: 'Tiles with proper India boundaries<a href="https://openstreetmap.in/">Openstreetmap.in</a> &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> Contributors'});
26+
27+
28+
var map = L.map('map', {
29+
'center': [27,77],
30+
'zoom': 5,
31+
'layers': osmIn
32+
});
33+
34+
35+
</script>
36+
</body>
37+
</html>

0 commit comments

Comments
 (0)