Skip to content

Customize disableClusteringAtZoom level by transit mode #99

@mbjackson-capp

Description

@mbjackson-capp

A Leaflet MarkerCluster layer is initialized with a disableClusteringAtZoom parameter, with a value between 0 (all the way zoomed out) and 19 (all the way zoomed in). I set it at 16, which is roughly the level at which you should know when bus stops along the same street are distinct.

However, I suspect that the proper clustering level is dependent on mode of transit: you want subway stations to be fully declustered at a more zoomed out level (perhaps 11 or 12) and commuter rail to decluster even further out than that (maybe 9 or 10)
.
This suggests we might actually want initialize multiple MarkerClusters on the map: one per mode of transit, as determined by the GTFS route_type attribute (which exists in our backend). Potential follow-up issue to that: let user toggle on/off the MarkerClusters by mode as desired (display the subway stops but not the buses, e.g.)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions