Get started with leaflet CDN
BSD-2-Clause licensed
Leaflet: Lightweight open-source map, location service library.
Tags:- maps
- mobile
Stable version
Copied!
How to start using leaflet CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with leaflet CDN - cdnhub.io</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.css"/>
<script src="https://cdn.cdnhub.io/leaflet/1.9.4/leaflet.js"></script>
</head>
<body>
<div id="mapid" style="height: 400px; width: 100%;"></div>
<script>
const map = L.map('mapid').setView([51.505, -0.09], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
maxZoom: 19
}).addTo(map);
L.marker([51.5, -0.09])
.addTo(map)
.bindPopup('A marker popup!')
.openPopup();
</script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
0.3.1
0.4.5
0.5
0.5.1
0.6
0.6.0
0.6.1
0.6.2
0.6.3
0.6.4
0.7.0
0.7.1
0.7.2
0.7.3
0.7.4
0.7.5
0.7.7
1.0.0
1.0.0-beta.1
1.0.0-beta.2
1.0.0-beta.2.rc
1.0.0-beta.2.rc.2
1.0.0-rc.1
1.0.0-rc.2
1.0.0-rc.3
1.0.1
1.0.2
1.0.3
1.1.0
1.2.0
1.3.0
1.3.1
1.3.2
1.3.3
1.3.4
1.4.0
1.5.0
1.5.1
1.6.0
1.7.0
1.7.1
1.8.0
1.8.0-alpha.0
1.8.0-beta.0
1.8.0-beta.1
1.8.0-beta.2
1.8.0-beta.3
1.9.0
1.9.1
1.9.2
1.9.3
*** 1.9.4