Skip to content

Instantly share code, notes, and snippets.

@leonardehrenfried
Created November 16, 2022 09:42
Show Gist options
  • Save leonardehrenfried/6d36ae2b58dd9ee7329e5f81bf30b844 to your computer and use it in GitHub Desktop.
Save leonardehrenfried/6d36ae2b58dd9ee7329e5f81bf30b844 to your computer and use it in GitHub Desktop.
Add OTP vector tile layer to maplibre
map.addSource('stops', {
type: 'vector',
url: "http://localhost:8080/otp/routers/default/vectorTiles/rentals/tilejson.json"
});
map.addLayer({
"id": "stops",
"type": "circle",
"source": "stops",
'source-layer': 'rentals',
"layout": {},
"paint": {
"circle-radius": {
"base": 1.1,
"stops": [[6, 0.5], [17, 9]]
},
"circle-color": "#f73109",
"circle-opacity": 0.9
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment