Leaflet starter
Leaflet: an interactive map with OpenStreetMap tiles, a marker, and shapes.
Open in editor Free. No install, no sign-up.
- leaflet
The code
Three files, exactly what you get in the editor.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Leaflet starter</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
</head>
<body>
<div id="map"></div>
<a href="https://leafletjs.com" target="_blank" class="badge"
><svg class="logo" viewBox="0 0 24 24" role="img" aria-label="Leaflet">
<path
fill="#199900"
d="M17.69 0c-.355.574-8.432 4.74-10.856 8.649-2.424 3.91-3.116 6.988-2.237 9.882.879 2.893 2.559 2.763 3.516 3.717.958.954 2.257 2.113 4.332 1.645 2.717-.613 5.335-2.426 6.638-7.508 1.302-5.082.448-9.533-.103-11.99A35.395 35.395 0 0 0 17.69 0zm-.138.858l-9.22 21.585-.574-.577Z"
/>
</svg>
Leaflet</a
>
</body>
</html>
Questions
Can I use Leaflet without a build step?
Yes. This starter loads Leaflet straight from a CDN, so it runs in the browser with no npm install, bundler, or config.
How do I start a Leaflet project online?
Click Open in editor. HTMLDrop copies this starter into a new drop with index.html, style.css, and script.js, and the preview updates as you edit.
Is it free?
Yes. Public drops, live collaboration, versions, and embeds are free, and you do not need an account to start.
Can I share or embed my Leaflet demo?
Yes. Every drop gets a public link and an embed code, and you can invite others to edit it with you in real time.