Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Leafletで地図を表示するためのサンプルコード。
<html>
<head>
<title>An example of a map by leaflet.</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css"
integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js"
integrity="sha512-nMMmRyTVoLYqjP9hrbed9S+FzjZHW5gY1TWCHA5ckwXZBadntCNs8kEqAWdrb9O7rxbCaA4lKTIWjDXZxflOcA=="
crossorigin=""></script>
<script type="text/javascript">
function init() {
var map = L.map('mapid').setView([35.510281, 139.606164], 16);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
L.marker([35.510281, 139.606164]).addTo(map)
.bindPopup('International Stadium Yokohama<br>横浜国際総合競技場')
.openPopup();
}
</script>
</head>
<body onload="init()">
<div id="mapid" style="height: 400px; width: 600px;"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.