Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: realtime bus position #39

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

andraantariksa
Copy link
Member

@andraantariksa andraantariksa commented Feb 8, 2025

Fix #37

@andraantariksa andraantariksa marked this pull request as draft February 8, 2025 05:56
Comment on lines -60 to -110
map.addSource("opentije_bus_stops", {
type: "geojson",
data: {
type: "FeatureCollection",
features: [],
},
});
map.addLayer({
id: "opentije_bus_stops-label",
type: "symbol",
source: "opentije_bus_stops",
minzoom: 13,
layout: {
"text-field": ["get", "name"],
"text-font": ["Noto Sans Regular"],
"text-variable-anchor": ["left", "right"],
"text-radial-offset": 0.5,
"text-justify": "auto",
},
});
map.addLayer({
id: "opentije_bus_stops",
type: "circle",
source: "opentije_bus_stops",
paint: {
"circle-color": ["get", "color"],
},
});

map.addSource("opentije_bus_lanes", {
type: "geojson",
data: {
type: "FeatureCollection",
features: [],
},
});
map.addLayer({
id: "opentije_bus_lanes",
type: "line",
source: "opentije_bus_lanes",
paint: {
"line-width": 3,
"line-color": ["get", "color"],
},
});

map.on("click", "opentije_bus_stops", (target) => {
const busStopId = target.features![0].properties.id;
setSelectedBusStop(busStopId);
});

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be refactored later

Copy link

Deploying opentije with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9c5c800
Status: ✅  Deploy successful!
Preview URL: https://83df1821.opentije.pages.dev
Branch Preview URL: https://realtime-bus-position.opentije.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Realtime bus position
1 participant