Skip to content

Instantly share code, notes, and snippets.

@zakgrant
Last active December 20, 2015 19:28
Show Gist options
  • Save zakgrant/6182852 to your computer and use it in GitHub Desktop.
Save zakgrant/6182852 to your computer and use it in GitHub Desktop.
Bike route through the Kells hills via:geojson.io
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.marker-properties {
border-collapse:collapse;
font-size:11px;
border:1px solid #eee;
margin:0;
}
.marker-properties th {
white-space:nowrap;
border:1px solid #eee;
padding:5px 10px;
}
.marker-properties td {
border:1px solid #eee;
padding:5px 10px;
}
.marker-properties tr:last-child td,
.marker-properties tr:last-child th {
border-bottom:none;
}
.marker-properties tr:nth-child(even) th,
.marker-properties tr:nth-child(even) td {
background-color:#f7f7f7;
}
</style>
<script src='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.ie.css' rel='stylesheet' >
<![endif]-->
</head>
<body>
<div id='map'></div>
<script type='text/javascript'>
var map = L.mapbox.map('map');
L.mapbox.tileLayer('tmcw.map-ajwqaq7t', {
retinaVersion: 'tmcw.map-u8vb5w83',
detectRetina: true
}).addTo(map);
map.attributionControl.addAttribution('<a href="http://geojson.io/">geojson.io</a>');
$.getJSON('map.geojson', function(geojson) {
var geojsonLayer = L.geoJson(geojson).addTo(map);
map.fitBounds(geojsonLayer.getBounds());
geojsonLayer.eachLayer(function(l) {
showProperties(l);
});
});
function showProperties(l) {
var properties = l.toGeoJSON().properties, table = '';
for (var key in properties) {
table += '<tr><th>' + key + '</th>' +
'<td>' + properties[key] + '</td></tr>';
}
if (table) l.bindPopup('<table class="marker-properties display">' + table + '</table>');
}
</script>
</body>
</html>
Display the source blob
Display the rendered blob
Raw
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"": ""
},
"geometry": {
"type": "LineString",
"coordinates": [
[
-6.2381744384765625,
54.81532673863048
],
[
-6.233024597167969,
54.813348417419284
],
[
-6.229248046875,
54.812952741550895
],
[
-6.226158142089844,
54.813348417419284
],
[
-6.223411560058594,
54.81216137818777
],
[
-6.22100830078125,
54.81216137818777
],
[
-6.216888427734375,
54.81374408941228
],
[
-6.205902099609375,
54.81987650974958
],
[
-6.201438903808594,
54.82106332227874
],
[
-6.192169189453125,
54.82205230607877
],
[
-6.172943115234374,
54.826007999094955
],
[
-6.167106628417968,
54.82759016780595
],
[
-6.131401062011719,
54.82897451457229
],
[
-6.123504638671875,
54.829963304631114
],
[
-6.096382141113281,
54.82877675365454
],
[
-6.090888977050781,
54.83016105973692
],
[
-6.081275939941406,
54.82798570029684
],
[
-6.069602966308594,
54.82857899176812
],
[
-6.0569000244140625,
54.82679909119997
],
[
-6.038360595703125,
54.82679909119997
],
[
-6.022224426269531,
54.82818346508927
],
[
-6.01226806640625,
54.8269968618045
],
[
-5.9896087646484375,
54.82521689149074
],
[
-5.98102569580078,
54.82581022364696
],
[
-5.9758758544921875,
54.82561244723026
],
[
-5.970726013183594,
54.82501911216791
],
[
-5.964546203613281,
54.82482133187636
],
[
-5.954933166503906,
54.82145891870501
],
[
-5.943946838378905,
54.82027211780103
],
[
-5.9305572509765625,
54.81690932584367
],
[
-5.926094055175781,
54.819085282021355
],
[
-5.917510986328125,
54.82363462978407
],
[
-5.908241271972656,
54.82838122891303
],
[
-5.901374816894531,
54.83016105973692
],
[
-5.8948516845703125,
54.834313693204265
],
[
-5.89038848876953,
54.83312727008725
],
[
-5.893135070800781,
54.82798570029684
],
[
-5.89862823486328,
54.82343684271147
],
[
-5.898284912109375,
54.819085282021355
],
[
-5.900688171386719,
54.81690932584367
],
[
-5.908241271972656,
54.81611803998763
],
[
-5.914421081542969,
54.812359220481866
],
[
-5.917510986328125,
54.80840219051293
],
[
-5.9236907958984375,
54.80622565883166
],
[
-5.928497314453125,
54.80464265306068
],
[
-5.940513610839844,
54.79850791995203
],
[
-5.961456298828125,
54.79593501279976
],
[
-5.967979431152344,
54.79474746195475
],
[
-5.9930419921875,
54.798903737286025
],
[
-6.017074584960937,
54.80068486732233
],
[
-6.040420532226562,
54.79929955074388
],
[
-6.054496765136719,
54.79831000983151
],
[
-6.05072021484375,
54.79652877513986
],
[
-6.048316955566406,
54.79138254510432
],
[
-6.0569000244140625,
54.7943516039205
],
[
-6.066856384277344,
54.797122528758486
],
[
-6.085739135742187,
54.795737090081595
],
[
-6.102561950683594,
54.79494538951827
],
[
-6.11114501953125,
54.79237225560392
],
[
-6.1283111572265625,
54.79514331611269
],
[
-6.1392974853515625,
54.796726693981796
],
[
-6.148223876953125,
54.797914186683315
],
[
-6.15234375,
54.79692461185468
],
[
-6.15509033203125,
54.79652877513986
],
[
-6.1571502685546875,
54.79771627365569
],
[
-6.169166564941406,
54.79811209874194
],
[
-6.175346374511719,
54.798903737286025
],
[
-6.194572448730469,
54.802465918869224
],
[
-6.199378967285156,
54.803653242962746
],
[
-6.202125549316406,
54.804840532173365
],
[
-6.206932067871094,
54.806423530192795
],
[
-6.210021972656249,
54.806027786501595
],
[
-6.213111877441406,
54.80622565883166
],
[
-6.2162017822265625,
54.80741287246441
],
[
-6.2203216552734375,
54.80840219051293
],
[
-6.224784851074219,
54.8086000512159
],
[
-6.231651306152344,
54.807215005947945
],
[
-6.233367919921874,
54.80761073801195
],
[
-6.237831115722656,
54.80662140058496
],
[
-6.24298095703125,
54.80761073801195
],
[
-6.244010925292969,
54.81057860495577
],
[
-6.245384216308594,
54.81354625390022
],
[
-6.248474121093749,
54.81611803998763
],
[
-6.250877380371094,
54.818294038792615
],
[
-6.239891052246094,
54.81532673863048
]
]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment