Created
November 16, 2022 09:42
-
-
Save leonardehrenfried/6d36ae2b58dd9ee7329e5f81bf30b844 to your computer and use it in GitHub Desktop.
Add OTP vector tile layer to maplibre
This file contains hidden or 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
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