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

Distance offset and zoom behaviour #75

Open
jaluebbe opened this issue Feb 5, 2020 · 4 comments
Open

Distance offset and zoom behaviour #75

jaluebbe opened this issue Feb 5, 2020 · 4 comments

Comments

@jaluebbe
Copy link
Contributor

jaluebbe commented Feb 5, 2020

The Heightgraph provides a great overview even for long tracks of several 100km. However, local details of this track may be of interest but are not visible as their length is short compared to the graph.
An thinkable option to circumvent this could be to create a second Heightgraph window which shows the graph for the selected area only (maybe there are much better solutions).
To realise this, two options would be nice to have when initialising Heightgraph:

  1. provide an offset for the distance axis, e.g. to start counting the distance with 112.5km.
  2. provide a callback function when _dragEndHandler is called. It could supply the distance values where the zoomed area starts/ends or even provide a geojson of the selected track segment which could be fed into the second instance of Heightgraph where the distance offset is applied.
@boldtrn
Copy link
Contributor

boldtrn commented Feb 10, 2020

Good idea, thanks for the proposal! To throw some alternatives in the ring:

When you select a part of the elevation by dragging the mouse, the map zooms to that area. We could also "zoom" the heightgraph. When we zoom out again, the zoom is reset to default.

Using your solution with multiple heightgraphs is interesting as well. Maybe we could allow showing multiple heightgraphs on one page. This would require to specify a container for the heightgraph. Therefore the heightgraph could be shown outside of the map as well, which might be interesting for some use cases as well. Once we can show multiple heightgraphs programmatically some callback function could allow any application to create another heightgraph for different use cases.

In any case, PRs are welcome :)

@jaluebbe
Copy link
Contributor Author

Zooming the Heightgraph while showing the proper distance axis segment sounds interesting and is exactly what I need.

@jaluebbe
Copy link
Contributor Author

Multiple Heightgraphs on one page could be interesting as well. It could be e.g. a comparison of GPS altitude, barometric and elevation model data. Or viewing surface type and steepness at the same time.

@nrenner
Copy link

nrenner commented May 16, 2022

Leaflet.Elevation has a pending PR #65 Zoom elevation plot that supposedly also zooms the current graph when dragging a zoom range, maybe something to copy from (also MIT License).

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

3 participants