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

Calculate gradients and show slopes #6

Draft
wants to merge 32 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
75a9453
fix issue with shallow clone of last bounds
krmr May 1, 2018
612f855
handling of multiple segments in GPX
krmr May 1, 2018
6af6261
Merge remote-tracking branch 'upstream/master'
krmr Jan 18, 2019
08d315d
workaround for issues with labels when using other languagues
krmr Jan 19, 2019
58bcbe6
Update readme
krmr Jan 19, 2019
d7ad556
fix elevation calculation for multiple tracks
krmr Jan 19, 2019
eba3305
update URL
krmr Jan 20, 2019
890aa3f
first attempt at gradient
krmr Jan 22, 2019
81a2dd6
fix issue with waypoints in gpx
krmr Jan 22, 2019
f361fe8
Merge branch 'master' into gradient
krmr Jan 22, 2019
636d729
implement slope computation and display
krmr Jan 23, 2019
0fc5b08
change example track
krmr Jan 27, 2019
effd6c1
fix issue with empty track, simplify slope analysis
krmr Feb 3, 2019
b749c36
another attempt at selecting relevant slopes
krmr Feb 5, 2019
59552a3
Merge remote-tracking branch 'upstream/master'
krmr Feb 22, 2019
314bfbb
Merge branch 'master' into gradient
krmr Feb 22, 2019
c90c010
add elevation smoothing and provide UI
krmr Feb 24, 2019
9c30a46
remove duplicate trackpoints
krmr Feb 25, 2019
c600b5b
fix issue that waypoints are shown only for first track
krmr May 30, 2019
9d5b263
Merge branch 'master' into gradient
krmr May 30, 2019
1be603c
fix issue with MultiLineString geometry
krmr Jun 3, 2019
97a0041
Merge branch 'master' into gradient
krmr Jun 3, 2019
51dbd35
fix issue with MultiLineString not showing in map
krmr Jun 22, 2019
a979c3d
Merge branch 'master' into gradient
krmr Jun 22, 2019
df9d648
Merge remote-tracking branch 'upstream/master'
krmr Apr 25, 2020
417a21f
fix build script
krmr Apr 25, 2020
f1919d9
Merge branch 'master' into gradient
krmr Apr 25, 2020
8196bcf
fix error in git hook
krmr Apr 25, 2020
7f23a14
Merge branch 'master' into gradient
krmr Apr 25, 2020
a056996
Merge remote-tracking branch 'upstream/master'
krmr May 31, 2024
57f47f6
update to work with current version of parcel
krmr May 31, 2024
8256eab
Merge branch 'master' into gradient
krmr May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ demo/
.cache
src/mapboxtoken.js
TODO.md
.parcel-cache
/yarn.lock
/.vscode/launch.json
5 changes: 0 additions & 5 deletions .postcssrc

This file was deleted.

90 changes: 45 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# mapline

Create a collection of accurate maps in print quality along your gpx or kml track, in your scale,
your format and the infos you need.

Create a collection of accurate maps in print quality along your gpx or kml track, in
your scale, your format and the infos you need.

[Demo page](https://sgelb.github.io/demo/mapline/)
### Adaptations
Compared to the [original](https://github.com/sgelb/mapline) this fork adds
some features that I personally like. For example support for tracks made up
from separate segments in the same file. Or showing alternative routes with a
different style.

![Screenshot](screenshot.jpg)


### Features
Expand All @@ -12,78 +21,69 @@ your scale, your format and the infos you need.
- Customizable paper format up to A2, page margins and distance markers
- Support of waypoints

Inspired by the [bikeline Cycling
guides](http://www.esterbauer.com/international.html) and
[Openstreetmap](https://www.openstreetmap.org/about), this application uses
[Mapbox GL JS](https://www.mapbox.com/mapbox-gl-js/api/) to create the maps I
need. Vector tiles enable rendering in 300dpi, high enough for printing. There
are different styles available. Paper format, page margins and distance markers
are customizable. You want a map in 1:85.000 on A5 paper along that winding
river? No problem.
Inspired by the [bikeline Cycling guides](http://www.esterbauer.com/international.html) and
[Openstreetmap](https://www.openstreetmap.org/about), this application uses [Mapbox GL
JS](https://www.mapbox.com/mapbox-gl-js/api/) to create the maps I need. Vector tiles enable
rendering in 300dpi, high enough for printing. There are different styles available. Paper format,
page margins and distance markers are customizable. You want a map in 1:85.000 on A5 paper along
that winding river? No problem.


### Waypoints and POIs

Waypoints contained in the GPX can set a symbol name through the optional
[`sym`](https://www.rigacci.org/wiki/doku.php/tecnica/gps_cartografia_gis/gpx)
field. You can set the used icon by specify any [Maki
icon](https://www.mapbox.com/maki-icons/) by using their basename e.g.
_campsite-11_ in this field.

Additional POIs can be downloaded via
[Overpass](https://wiki.openstreetmap.org/wiki/Overpass_API). To add more
choices, see
[overpass.js](https://github.com/sgelb/mapline/blob/master/src/overpass.js).
POIs are downloaded for print areas only. In case of format or scale changes,
manually refresh by toggling the checkboxes.
[`sym`](https://www.rigacci.org/wiki/doku.php/tecnica/gps_cartografia_gis/gpx) field. You can set
the used icon by specify any [Maki icon](https://www.labs.mapbox.com/maki-icons/) by using their
basename e.g. _campsite-11_ in this field.

Additional POIs can be downloaded via [Overpass](https://wiki.openstreetmap.org/wiki/Overpass_API).
To add more choices, see
[overpass.js](https://github.com/sgelb/mapline/blob/master/src/overpass.js). POIs are downloaded for
print areas only. In case of format or scale changes, manually refresh by toggling the checkboxes.

### Development

Logic and PDF generation of `mapline` are performed client-side. Main external
libraries are [Mapbox GL JS](https://www.mapbox.com/mapbox-gl-js/) for map
creation and [jsPDF](https://github.com/MrRio/jsPDF) for PDF generation.
Logic and PDF generation of `mapline` are performed client-side. Main external libraries are [Mapbox
GL JS](https://www.mapbox.com/mapbox-gl-js/) for map creation and
[jsPDF](https://github.com/MrRio/jsPDF) for PDF generation.

Before you can use `mapline`, you have to get your own [Mapbox access
token](https://www.mapbox.com/help/create-api-access-token/). Save it in
`src/mapboxtoken.js`:
token](https://docs.mapbox.com/help/glossary/access-token). Save it in `src/mapboxtoken.js`:

export default '<your access token here>';

- `yarn install` should install all dependencies
- `yarn run serve` to start a dev server
- `yarn run build` generates a production build in `/dist`
- `yarn install` installs all dependencies
- `yarn run serve` starts a dev server
- `yarn run dist ` generates a production build in `/dist`

### Prebuilds

Since v0.16.0, a bundled version is published for tagged commits in
`prebuild/`. See
[prebuild/README.md](https://github.com/sgelb/mapline/blob/master/prebuild/README.md)
for more infos on how to use it.
Since v0.16.0, a bundled version is published for tagged commits in `prebuild/`. See
[prebuild/README.md](https://github.com/sgelb/mapline/blob/master/prebuild/README.md) for more infos
on how to use it.

Prebuilds are generated using git hooks, see
[git-hooks/README.md](https://github.com/sgelb/mapline/blob/master/git-hooks/README.md)
for details.
`yarn run prebuild` prepares all files in `/prebuild`. Finished prebuilds are then generated using
git hooks, see
[git-hooks/README.md](https://github.com/sgelb/mapline/blob/master/git-hooks/README.md) for details.

### Limitations

An application written in Javascript, using WebGL and running entirely in the
browser has of course some limitations.
An application written in Javascript, using WebGL and running entirely in the browser has of course
some limitations.

- [canvas size](https://webglstats.com/webgl/parameter/MAX_RENDERBUFFER_SIZE)
and hence the maximum page format depend on your graphics card
- Javascript engines have a hardcoded maximum string size. This limits the size
of the output PDF to
[~268.44MB](https://github.com/atom/atom/issues/7210#issuecomment-160994222)
- [canvas size](https://webglstats.com/webgl/parameter/MAX_RENDERBUFFER_SIZE) and hence the maximum
page format depend on your graphics card
- at least in the past, Javascript engines had a hardcoded maximum string size. This limited the
size of the output PDF to
[~268.44MB](https://github.com/atom/atom/issues/7210#issuecomment-160994222). I do not know where the limits are now.

### Missing features and nice-to-haves

- a map style better suited for cycle tours and printing in black&white
- a scale bar on the printouts
- elevation stats and marking of steep slopes
- support for multiple tracks

### Want to participate?

Although development is slow, this is not a dead project and pull-requests
are always welcome!
Although development is slow, this is not a dead project and pull-requests are always welcome!

Loading