Improve positioning controls and add position indicator to map#8
Improve positioning controls and add position indicator to map#8dodoradio wants to merge 4 commits into
Conversation
- split out identical buttons - remove z values
oneshot position updates don't work the same for all position sources. For example, some GPS modules shut down after a oneshot update, and so every click of the 'recenter' button may take over a minute to respond. This introduces some new behaviours and states for the recenter button. - if the positioning source is off, one tap turns it on - subsequent taps centre the map to the latest position - a long press turns the module off (this needs further work, I'm not sure this is discoverable or intuitive) - the button changes visually to indicate when position is off, acquiring or acquired or invalid - this also adds a 'lock' icon, which isn't currently used - due to the amount of icons added, they've been moved into a subdirectory
moWerk
left a comment
There was a problem hiding this comment.
This is not a code review, but i tested on catfish just now. complied fine and the feature is working fine.
Great work pushing this forward!
FlorentRevest
left a comment
There was a problem hiding this comment.
Just one comment - otherwise looks good to me
| install(FILES ios-locate-dot-alert.svg DESTINATION /usr/share/icons/asteroid/) | ||
| install(FILES ios-locate-lock.svg DESTINATION /usr/share/icons/asteroid/) | ||
| install(FILES waypoint.svg DESTINATION /usr/share/icons/asteroid/) | ||
| install(FILES ios-topographic-outline.svg DESTINATION /usr/share/icons/asteroid/) |
There was a problem hiding this comment.
Could you PR to https://github.com/AsteroidOS/asteroid-icons-ion/tree/master/src instead ?
There was a problem hiding this comment.
I'd prefer not to, as these icons aren't really reusable. I'd prefer not to install them here, but our Icon doesn't support loading from anything but the icons directory, and I decided not to mix Icons with Images
There was a problem hiding this comment.
I'd say we already have some icons that are not reusable and that's perfectly ok.
If you really really really think they have nothing to do in there, then I'd instead suggest fixing Icon in qml-asteroid to support full paths and install those icons to a separate directory that clearly distinguishes them from our default icon set. This will avoid conflict in case someone decides to name an icon like that. And even if it's unlikely with the current names, it's still an anti-pattern we should avoid as setting bad precedent.
1: improves positioning control
This reworks the recenter button to turn on the position source instead of requesting oneshot updates. Oneshot position updates don't work the same for all position sources: for example, some GPS modules shut down after a oneshot update, and so every click of the 'recenter' button currently may take many minutes to respond, while providing no feedback.
This also introduces some new behaviours and states for the recenter button.
if the positioning source is off, one tap turns it on
subsequent taps centre the map to the latest position
a long press turns the module off (this needs further work, I'm not
sure this is discoverable or intuitive)
the button changes visually to indicate when position is off,
acquiring or acquired or invalid
this also adds a 'lock' icon which can also fit inside ios-locate, intended to indicate that the view is locked to user's position. This icon isn't currently used, but I want to include it so it's there for when this feature is added.
due to the amount of icons added, they've been moved into a subdirectory
To enable these changes, I refactored the map controls to reduce code duplication and make bindings a bit more explicit.
2: Adds an indicator for the user's current position on the map
This adds a circle to the map which follows the user's current position. The size of the circle indicates the position error.
Unfortunately, MapCircle has really obvious aliasing, but this is the way it's shown on the Qt website, so I don't think there's a clear fix. If this is too ugly, we can eventually replace it with a scaled MapQuickItem.
To enable this change, I had to fix up the code that refreshes waypoints, as it would remove all items from the map, rather than just waypoints.