-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic HTML/Javascript to load a default map and a single isochrone. F…
…ixes #1
- Loading branch information
Adrian McEwen
committed
May 30, 2020
1 parent
4da0b05
commit 1d7ccce
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" | ||
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" | ||
crossorigin=""/> | ||
<style type="text/css"> | ||
#mainmap { height: 500px } | ||
</style> | ||
|
||
<!-- Make sure you put this AFTER Leaflet's CSS --> | ||
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" | ||
integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew==" | ||
crossorigin=""></script> | ||
<!-- Load the isochrone GeoJSON. | ||
This should get moved to an AJAX call to pull the raw JSON in long-term --> | ||
<script src="tmpiso.js"></script> | ||
|
||
</head> | ||
<body> | ||
<h1>Should Liverpool be a 15 Minute City?</h1> | ||
<div id="mainmap"> | ||
</div> | ||
<script> | ||
var mainMap; | ||
window.onload = function() { | ||
mainMap = L.map('mainmap').setView([53.4105095,-2.9704659], 12) | ||
//mainMap = L.map('mainmap').setView([51.505, -0.09], 13); | ||
var mapLink = '<a href="http://openstreetmap.org">OpenStreetMap</a>'; | ||
var ocmlink = '<a href="http://thunderforest.com/">Thunderforest</a>'; | ||
L.tileLayer( | ||
'https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=545d2bceafc34e60af2dd48c5ea3d00c', { | ||
attribution: '© '+mapLink+' Contributors & '+ocmlink, | ||
maxZoom: 18, | ||
}).addTo(mainMap); | ||
// Load the isochrones | ||
var isochrone = JSON.parse(iso); | ||
console.log(isochrone); | ||
L.geoJSON(isochrone).addTo(mainMap); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.