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

Ascent and descent metadata in elevation chart #29

Merged
merged 3 commits into from Dec 28, 2023

Conversation

MaximeChallon
Copy link

Hi,

During my use of Waymark on my site, I found that two pieces of information were missing from the elevation chart: total ascent and total descent. After some research, I discovered that the elevation chart was based on the library leaflet-elevation, but it seemed to be customized for Waymark as this library was condensed into a single file, leaflet-elevation.js.

The version used in Waymark is not up-to-date compared to the latest version of leaflet-elevation (which is not a problem), but leaflet-elevation now includes these ascent and descent features.

The documentation for this library includes information on ascent and descent (example; main code). Therefore, I took the liberty of proposing an improvement to Waymark so that Total Ascent and Total Descent appear in the graph data.

This merge request can be considered a simple proposal, and I see a few drawbacks:

  • I tested the code on my site, and the result is as follows:
    image
  • I couldn't find any regression unit tests, so I hope this doesn't introduce any bugs.
  • I minified waymark-js for testing, so one of the commits in this pull request only concerns the minified file waymark-js.min.js in case the minification wasn't done correctly.
  • The addition of Total Ascent and Total Descent is made for everyone: is it relevant, or should it be made an option (in shortcode or in Waymark settings)? (If it should be an option, unfortunately, it exceeds my skills. :( )

I hope that this proposal can be integrated into a future version,
Best regards,

@morehawes morehawes changed the base branch from master to 2024_1_staging December 28, 2023 15:26
@morehawes
Copy link
Collaborator

Thank you so much for adding these @MaximeChallon, I really appreciate it! This has definitely been suggested before and I just have not had the time to delve into this one. Your changes look great and will be included in the next release :)

The version used in Waymark is not up-to-date compared to the latest version of leaflet-elevation (which is not a problem), but leaflet-elevation now includes these ascent and descent features.

Yes that's right. Unfortunately the combination of Leaflet plugins and my own custom code/hacks got to he point where I had to nail down specific versions. I do plan on changing this in the future!

I couldn't find any regression unit tests, so I hope this doesn't introduce any bugs.

Also something I would like to rectify in the future :0)

I minified waymark-js for testing, so one of the commits in this pull request only concerns the minified file waymark-js.min.js in case the minification wasn't done correctly.

There is a built step that combines and minifies the assets (as well as some other plugin chores like adding localization/translation entries). This is done with Grunt and I will endeavour to add more information about that to the GitHub page because I want to improve the "developer experience" for the plugin.

The addition of Total Ascent and Total Descent is made for everyone: is it relevant, or should it be made an option (in shortcode or in Waymark settings)? (If it should be an option, unfortunately, it exceeds my skills. :( )

I think adding for everyone is fine for now, can revisit/add documentation on hiding with CSS if necessary.

Thanks again!

@morehawes morehawes merged commit 598cd7d into OpenGIS:2024_1_staging Dec 28, 2023
morehawes added a commit that referenced this pull request Jan 15, 2024
Squashed commit of the following:

commit caf1f15c0e04b0dfd83a9d43dc9b25576cb53969
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 14 18:10:58 2024 -0800

    Readme tweaks

commit 0ef582775c45cbbf068d0911bb4a2aa5779a241f
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 14 18:05:30 2024 -0800

    Version numbers

commit 37ae8564190de23ae2fe74dce0b69aab4c63909a
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 14 18:02:46 2024 -0800

    Wording tweaks

commit c44c11e
Merge: e65800a 2801de7
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 14 17:35:02 2024 -0800

    Merge branch '1_staging' of https://github.com/morehawes/waymark into 1_staging

    # Conflicts:
    #	languages/waymark.pot

commit e65800a
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 14 17:33:43 2024 -0800

    POT

commit 2801de7
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 14 16:34:53 2024 -0800

    PHP Fix

commit d5c1fc1
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 14 08:57:34 2024 -0800

    Helper improvements

commit 3108116
Merge: 28a3116 3f7b38e
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 14 05:27:11 2024 -0800

    Merge branch '2024_1_staging' of github.com:opengis/waymark into 2024_1_staging

    # Conflicts:
    #	assets/dist/waymark-js/js/waymark-js.min.js
    #	waymark-js/dist/js/waymark-js.min.js

commit 28a3116
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 14 05:26:53 2024 -0800

    Gallery zoom

    Zoom in to 16 when a gallery image is clicked

commit 3f7b38e
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sat Jan 13 07:37:59 2024 -0800

    3

commit 65a4fb8
Merge: c164ce2 c3e4e87
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sat Jan 13 07:36:06 2024 -0800

    Merge branch '2024_1_staging' of https://github.com/OpenGIS/Waymark into 2024_1_staging

    # Conflicts:
    #	assets/dist/waymark-js/js/waymark-js.min.js
    #	languages/waymark.pot
    #	waymark-js/dist/js/waymark-js.min.js

commit c164ce2
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sat Jan 13 07:35:35 2024 -0800

    Minor improvements

commit c3e4e87
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sat Jan 13 05:46:05 2024 -0800

    Tidying up

commit 3801051
Merge: e640c27 cc2acfa
Author: Joe Hawes <morehawes@gmail.com>
Date:   Thu Jan 11 18:45:09 2024 -0800

    Merge branch '2024_1_staging' of https://github.com/morehawes/waymark into 2024_1_staging

commit e640c27
Author: Joe Hawes <morehawes@gmail.com>
Date:   Thu Jan 11 18:45:01 2024 -0800

    Added build_overlay_content()

commit e3cfbf2
Author: Joe Hawes <morehawes@gmail.com>
Date:   Thu Jan 11 14:02:18 2024 -0800

    Minor improvements

commit cc2acfa
Author: Joe Hawes <morehawes@gmail.com>
Date:   Thu Jan 11 08:11:25 2024 -0800

    Updated author URI

commit 250f2c1
Author: Joe Hawes <morehawes@gmail.com>
Date:   Thu Jan 11 08:10:08 2024 -0800

    Type heading/Type preview enhancements

commit b16ea43
Author: Joe Hawes <morehawes@gmail.com>
Date:   Wed Jan 10 17:35:34 2024 -0800

    Helper tweaks

commit 1c26464
Author: Joe Hawes <morehawes@gmail.com>
Date:   Wed Jan 10 14:16:04 2024 -0800

    Helper improvements

commit 4f72411
Author: Joe Hawes <morehawes@gmail.com>
Date:   Wed Jan 10 11:55:54 2024 -0800

    Helper improvements

commit b97f558
Author: Joe Hawes <morehawes@gmail.com>
Date:   Wed Jan 10 07:53:06 2024 -0800

    Helper improvements

commit 2ed5717
Merge: 891d3ff 613379d
Author: Joe Hawes <morehawes@gmail.com>
Date:   Wed Jan 10 07:08:06 2024 -0800

    Merge branch '2024_1_staging' of https://github.com/morehawes/waymark into 2024_1_staging

commit 613379d
Author: Joe Hawes <morehawes@gmail.com>
Date:   Wed Jan 10 06:29:19 2024 -0800

    Readme

commit 53a3d45
Author: Joe Hawes <morehawes@gmail.com>
Date:   Tue Jan 9 20:03:03 2024 -0800

    readme

commit 5681891
Author: Joe Hawes <morehawes@gmail.com>
Date:   Tue Jan 9 19:48:40 2024 -0800

    Waymark_GeoJSON phpDoc

commit 891d3ff
Author: Joe Hawes <morehawes@gmail.com>
Date:   Tue Jan 9 16:49:21 2024 -0800

    Added Helper function

commit f91d40b
Author: Joe Hawes <morehawes@gmail.com>
Date:   Tue Jan 9 15:41:51 2024 -0800

    Added build_icon_data & get_marker_background JS=>PHP equivalents

commit 822e09f
Author: Joe Hawes <morehawes@gmail.com>
Date:   Tue Jan 9 15:17:11 2024 -0800

    Housekeeping

commit db91d21
Author: Joe Hawes <morehawes@gmail.com>
Date:   Tue Jan 9 11:58:22 2024 -0800

    Error if callback function is not found

commit 28586cf
Author: Joe Hawes <morehawes@gmail.com>
Date:   Tue Jan 9 10:28:51 2024 -0800

    Geojson Properties bug fix

commit 976c01a
Author: Joe Hawes <morehawes@gmail.com>
Date:   Mon Jan 8 15:59:39 2024 -0800

    4

commit b8bf4dd
Author: Joe Hawes <morehawes@gmail.com>
Date:   Mon Jan 8 15:59:30 2024 -0800

    waymark_user_config check error

commit 69c9847
Author: Joe Hawes <morehawes@gmail.com>
Date:   Mon Jan 8 15:05:49 2024 -0800

    Attribution link tweak

commit 28378cd
Author: Joe Hawes <morehawes@gmail.com>
Date:   Mon Jan 8 13:39:24 2024 -0800

    3

commit c1473cb
Author: Joe Hawes <morehawes@gmail.com>
Date:   Mon Jan 8 10:37:25 2024 -0800

    Readme 2

commit 01e3388
Merge: 868cd5c 5884ec0
Author: Joe Hawes <morehawes@gmail.com>
Date:   Mon Jan 8 09:35:08 2024 -0800

    Merge branch '2024_1_staging' of github.com:opengis/waymark into 2024_1_staging

    # Conflicts:
    #	languages/waymark.pot

commit 868cd5c
Author: Joe Hawes <morehawes@gmail.com>
Date:   Mon Jan 8 09:34:44 2024 -0800

    Readme thanks

commit 5884ec0
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 7 19:12:35 2024 -0800

    Updated Settings Help links

commit 9f355d6
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 7 06:36:21 2024 -0800

    Updated Changes

commit c9d23b4
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sun Jan 7 06:27:54 2024 -0800

    Update github repo urls to use Open GIS

commit 4da2f50
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sat Jan 6 07:58:19 2024 -0800

    2

commit fd871b3
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sat Jan 6 07:45:56 2024 -0800

    Housekeeping

    Removed unused Queries code from Admin JS

commit 297b5e7
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sat Jan 6 07:22:36 2024 -0800

     Help remove thanks from plugin

commit 2080028
Author: Joe Hawes <morehawes@gmail.com>
Date:   Fri Jan 5 07:32:16 2024 -0800

    Updated readme

commit 720809a
Author: Joe Hawes <morehawes@gmail.com>
Date:   Fri Jan 5 07:28:32 2024 -0800

    fix: load_json reset_map_view

    commit 3b618d32367d715b5b22ff913eb4ffffe319204c
    Author: Joe Hawes <morehawes@gmail.com>
    Date:   Fri Jan 5 07:24:20 2024 -0800

        Always embed first Map

    commit cf0311063d0af8b8381c818c5b9fc4a049ad3ae2
    Author: Joe Hawes <morehawes@gmail.com>
    Date:   Fri Jan 5 07:16:08 2024 -0800

        Collections load_json reset view once

    commit f54693501343c7cf7bd7a7453bcd92dd0bd1fffe
    Merge: 9e87c068 6e8c265
    Author: Joe Hawes <morehawes@gmail.com>
    Date:   Fri Jan 5 06:59:02 2024 -0800

        Merge branch '2024_1_staging' into load_json

    commit 9e87c068676c4f90bc06d8a4d35afb2cf887a836
    Author: Joe Hawes <morehawes@gmail.com>
    Date:   Fri Jan 5 06:58:13 2024 -0800

        Reset view flag basics

commit 6e8c265
Author: Joe Hawes <morehawes@gmail.com>
Date:   Tue Jan 2 18:24:32 2024 -0800

    Minor typo

commit 598cd7d
Merge: 0e33dee f73dfb2
Author: Joe Hawes <morehawes@gmail.com>
Date:   Thu Dec 28 07:46:25 2023 -0800

    Merge pull request #29 from MaximeChallon/ascentDescent

    Ascent and descent metadata in elevation chart

commit f73dfb2
Author: Maxime Challon <maxime.challon@gmail.com>
Date:   Thu Dec 28 15:42:59 2023 +0100

    [ascent/descent] add fonctionnalities in dist waymark.min.js file

commit 0ac0ef3
Author: Maxime Challon <maxime.challon@gmail.com>
Date:   Thu Dec 28 15:42:49 2023 +0100

    [ascent/descent] add fonctionnalities in dist waymark.js file

commit bbccd2c
Author: Maxime Challon <maxime.challon@gmail.com>
Date:   Thu Dec 28 15:42:25 2023 +0100

    [ascent/descent] add fonctionnalities in src files

commit 0e33dee
Author: Joe Hawes <>
Date:   Tue Dec 26 07:32:28 2023 -0800

    Check for mime_content_type function

commit 9e10efe
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sat Dec 23 06:05:51 2023 -0800

    Minor Shortcode width/height fix

commit 04a812e
Author: Joe Hawes <morehawes@gmail.com>
Date:   Sat Dec 23 05:45:05 2023 -0800

    Header min-height fix

commit 8b4b967
Author: Joe Hawes <>
Date:   Thu Dec 21 12:46:43 2023 -0800

    Improved Shortcode Header Collection Shortcode logic

commit 05a5895
Author: Joe Hawes <>
Date:   Thu Dec 21 12:46:24 2023 -0800

    Maps & Collections in REST API
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.

None yet

2 participants