Skip to content

Commit

Permalink
Add basic bikemap
Browse files Browse the repository at this point in the history
  • Loading branch information
cblakkan committed Apr 27, 2024
1 parent 78a8f16 commit 4310e82
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 1 deletion.
5 changes: 5 additions & 0 deletions bikeroutes.json

Large diffs are not rendered by default.

83 changes: 82 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1,82 @@
:)
<script src='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.css' rel='stylesheet' />

<div id='map' style='width: 1200px; height: 720px;'></div>
<script type="text/javascript" src="bikeroutes.json"></script>
<script>
var map = new maplibregl.Map({
container: 'map',
style: 'https://api.maptiler.com/maps/b2512def-9887-424c-8274-dcae4a27558c/style.json?key=PhiQIVhvnvbs5yAOcy6M',
center: [-73.97,40.68],
zoom: 13
});

map.on('load', () => {
map.addSource('bikejson', {
'type': 'geojson',
'data': BIKEJSON
})

map.addLayer({
'id': 'protected',
'type': 'line',
'source': 'bikejson',
'paint': {
'line-color': "green",
'line-width': 5
},
'filter': [
'any',
['==', ['get', 'ft_facilit'], 'Protected Path'],
['==', ['get', 'tf_facilit'], 'Protected Path']

]
});

map.addLayer({
'id': 'greenway',
'type': 'line',
'source': 'bikejson',
'paint': {
'line-color': "green",
'line-width': 5
},
'filter': [
'any',
['==', ['get', 'ft_facilit'], 'Greenway'],
['==', ['get', 'tf_facilit'], 'Greenway']

]
});

map.addLayer({
'id': 'standards',
'type': 'line',
'source': 'bikejson',
'paint': {
'line-color': "blue",
'line-width': 5
},
'filter': [
'any',
['==', ['get', 'ft_facilit'], 'Standard'],
['==', ['get', 'tf_facilit'], 'Standard']
]
});

map.addLayer({
'id': 'sharrows',
'type': 'line',
'source': 'bikejson',
'paint': {
'line-color': "orange",
'line-width': 5
},
'filter': [
'any',
['==', ['get', 'ft_facilit'], 'Sharrows'],
['==', ['get', 'tf_facilit'], 'Sharrows']
]
});
})
</script>

0 comments on commit 4310e82

Please sign in to comment.