Skip to content

Instantly share code, notes, and snippets.

@pandanote-info
Last active November 25, 2018 11:08
Show Gist options
  • Save pandanote-info/b07c7f978afe1412fbc5e5d89b638b06 to your computer and use it in GitHub Desktop.
Save pandanote-info/b07c7f978afe1412fbc5e5d89b638b06 to your computer and use it in GitHub Desktop.
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