Repository navigation
feat(map): Show distance, direction, and elevation diff when long-pressing a point - #3913
Conversation
|
Hi, thank you for the contribution. It is fine for this pull request, but for future pull requests can you be sure to follow the pull request description template and CONTRIBUTING.md? Thank you! |
|
Thanks for the feedback! I've updated the implementation to embed the data points directly inside the existing share sheet instead of creating a separate one. The approach taken: Added an optional customView parameter to ActionSheet that gets inserted between the toolbar and the action buttons The data points now appear above the Beacon/Navigate/Distance buttons inside the single share sheet, styled consistently with the rest of the app. |
There was a problem hiding this comment.
This should also be present on the view photo maps fragment when the user selects a location on the map there (part of the Offline Maps tool). When you extract the component, be sure to make it part of the shared views so that offline maps doesn't reach into the map tool's package.
Once you've made the requested changes, can you also add tests to the androidTest for the map tool and offline maps tool? There are existing tests that long press the map, so just a couple of lines would be needed to verify it is displaying the correct information.
Can you also include screenshots when making the changes (you can update the description - there's a section in the template for screenshots)? It makes it easier to review since I usually only test locally if I don't have any large requested changes after reviewing the code.
a4cc9be to
df99061
Compare
|
Thanks for the detailed feedback! Here's what was updated: Extracted the data point row into LocationDataPointView in shared/views/ with setDistance(), setDirection(), and setElevationDiff() methods — keeps display logic out of the fragments and avoids cross-package dependencies |
b9931c6 to
141e62c
Compare
kylecorry31
left a comment
There was a problem hiding this comment.
Ideally I would like the text aligned with the icon, but to prevent further back and forth I'm going to merge this and make the change myself since that's pretty trivial. Thanks!


Closes #3878
Description
When the user long-presses a point on the map, the existing share sheet
now shows distance, direction, and elevation difference from the user's
current location to the selected point — displayed as
DataPointViewwidgets between the toolbar and the action buttons, styled consistently
with the rest of the app. This applies to both the Map tool and the
Offline Maps (photo maps) tool.
Changes:
LocationDataPointView: new shared view inshared/views/wrappinga horizontal row of three
DataPointViews withsetDistance(),setDirection(), andsetElevationDiff()methodsActionSheet: optionalcustomViewparameter inserted between thetoolbar and action buttons
Share.actions: forwardscustomViewtoActionSheetMapFragment: usesLocationDataPointViewandnavigation.elevationfor user elevation; subtitle restored
ViewPhotoMapFragment: same sheet added to long press handler usingaltimeter.altitudefor user elevationToolMapTest,ToolOfflineMapsTest: added assertions to verifydistance, direction, and elevation data points appear on long press
Testing
distance/direction/elevation data points, and Beacon/Navigate/Distance buttons