Leaflet demo

For update marker position

by ken3desu

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css">
<div id="map"></div>

CSS

#map {
    height: 500px;
    width: 80%;
}

JavaScript

// 地図
const osmUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png';
const osmAttrib = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors';
const osm = L.tileLayer(osmUrl, {
  maxZoom: 18,
  attribution: osmAttrib,
});
// 初期化
const map = L.map('map').setView([34.6982856, 137.6999814], 12).addLayer(osm);