Skip to content

Instantly share code, notes, and snippets.

@joshuahouston
Last active August 29, 2015 14:21
Show Gist options
  • Save joshuahouston/7adc35ef3a8780d4fa5e to your computer and use it in GitHub Desktop.
Save joshuahouston/7adc35ef3a8780d4fa5e to your computer and use it in GitHub Desktop.
Cross Trail - Old & New

My intention of this map is to show some photos of the nice improvements of the new trail, document the conditions of the old trail, and show how they relate to the surrounding muskeg spots.

Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>New Cross Trail</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
// create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map').setView([57.06, -135.316], 16);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
$.getJSON('crosstrail.json', function(data) {
var geojson = L.geoJson(data, {
pointToLayer: function(feature, latlng) {
return L.marker(latlng)
},
onEachFeature: function (feature, layer) {
layer.bindPopup(feature.properties.desc);
}
});
geojson.addTo(map);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment