[ios][android] Replacing altitude difference to ascent and descent #3062
No reviewers
Labels
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference: organicmaps/organicmaps-tmp#3062
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The app for pedestrian and cyclists route show altitude difference
between highest and lowest points. It's not too useful data in multiple
cases. More informative for hikers and cyclists from values of
elevation total ascent and total descent on route.
I replaced altitude difference to total ascent and total descent.
Current state
Example of route elevation profile where altitude difference between highest and lowest points is useless.
Result
iOS

Android

Thank you for your contribution! There are a few minor comments.
@ -264,17 +264,10 @@ final class RoutingBottomMenuController implements View.OnClickListener
{
mAltitudeChart.setImageBitmap(bm);
Looks like there are tabs and spaces mixed in the indentation. Please set the editor to use 2 spaces instead of tabs, and check/fix indentation in all your changes.
This call is unnecessary in the metric system, and the previous call is useless in the imperial one. Please rewrite the code without unnecessary function calls. We want to have the fastest app that eats less battery 😉
if
?@ -386,15 +387,16 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm
router.altitudeImagesData[sizeValue] = imageData;
Are feet (imperial system) work on iOS in this case?
tabs + spaces 😢
If totalAscent/Descent can't be negative, please use size_t for it.
There is a code style guide in the repo :)
@biodranik Thanks for review and you comments.
Will check and fix all soon
@ -264,17 +264,10 @@ final class RoutingBottomMenuController implements View.OnClickListener
{
mAltitudeChart.setImageBitmap(bm);
Fixed at d80c3a0
@ -264,17 +264,10 @@ final class RoutingBottomMenuController implements View.OnClickListener
{
mAltitudeChart.setImageBitmap(bm);
Removed unnecessary function calls d80c3a0
d80c3a0
@ -386,15 +387,16 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm
router.altitudeImagesData[sizeValue] = imageData;
Checked on iOS and Android there are similar code. All works with both measurement systems.
fixed
I used uint32_t instead size_t
Almost there )
Is there a warning here about uint to int conversion? static_cast<int32_t> is needed, probably also asserted that the uint value is not greater than an int one.
final
Can this constant be a part of the class and reused, to avoid unnecessary memory allocations on each moment?
Added explicit cast. But without assertion
I would argue about the swift lambda formatting, but let's leave it for future PRs )
Thanks