-
Notifications
You must be signed in to change notification settings - Fork 76
/
leafletjs.html
30 lines (30 loc) · 1.4 KB
/
leafletjs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>leafletjs</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>
</head>
<body>
<div id="mapid" style="width: 600px; height: 400px;"></div>
<script>
const mymap = L.map('mapid').setView([35.681236, 139.767125], 11);
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
attribution: 'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
maxZoom: 18,
id: 'mapbox/streets-v11',
tileSize: 512,
zoomOffset: -1,
accessToken: 'pk.eyJ1IjoibmlpeXoiLCJhIjoiY2tpdjduazhjMDJlZDJ0bnh5bWs4czFyaCJ9.pbrrtT-_PRnXAThvjJvQAw'
}).addTo(mymap);
fetch('https://raw.githubusercontent.com/niiyz/JapanCityGeoJson/go/geojson/13/13109.json')
.then(response => response.json())
.then(data => L.geoJSON(data).addTo(mymap));
</script>
</body>
</html>