Skip to content

Instantly share code, notes, and snippets.

@kkdd
Last active May 19, 2022 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkdd/06c3e5e7573f7268c7f0b5e3eb26262b to your computer and use it in GitHub Desktop.
Save kkdd/06c3e5e7573f7268c7f0b5e3eb26262b to your computer and use it in GitHub Desktop.
Leaflet map
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js"></script>
<style>
html, body {height: 100%; margin: 0; padding: 0;}
#map {height: 100%;}
</style>
</head>
<body>
<div id="map"></div>
<script>
const longitude = 139.8, latitue = 35.6, zoom = 10;
const map = L.map('map').setView([latitue, longitude], zoom);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {maxZoom: 22, maxNativeZoom: 18}).addTo(map);
L.control.scale().addTo(map);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment