Last active
May 19, 2022 06:44
-
-
Save kkdd/06c3e5e7573f7268c7f0b5e3eb26262b to your computer and use it in GitHub Desktop.
Leaflet map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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