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

Allow coordinates to be assigned to stations #223

Open
JDDurrant opened this issue Nov 12, 2024 · 0 comments
Open

Allow coordinates to be assigned to stations #223

JDDurrant opened this issue Nov 12, 2024 · 0 comments

Comments

@JDDurrant
Copy link

Currently, in this library, a station has the following shape:

{
  label: 'Central',
}

To indicate that a line serves a station, the following is included in the line's nodes array:

{
  name: 'CEN',
  labelPos: 'W',
  coords: [0, 0], // Mandatory property.
}

It looks like each station gets its coordinates on the map from a line's node. If a station is included in the stations object, but not included on any of the lines, the library throws an error.


Since a station's coordinates are immutable, and since each station marker can only have one label, I think the coords and labelPos properties should be assigned to the station object instead.

{
  label: 'Central',
  labelPos: 'W',
  coords: [0, 0],
}

When a line serves a station, the node showing this can have just the name property.

{
  name: 'CEN',
}

This node can then get its coords property from the matching station from the stations object.

When a line turns a corner, it should still use a single coords property, as before.

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

No branches or pull requests

1 participant