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
mobile: enable the map widget #1156
Conversation
Use one of the breeze icons for the map in the drawer on the mobile version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
The map widget on the mobile version requires that a dive object from a model has a dive_site uuid. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Add the following includes in the header - <QVariant> and <QGeoCoordinate> otherwise the mobile build fails. It is unclear how the desktop build does not complain about this. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
centerOnDiveSiteUUID() is a helper to center the map on a dive_site UUID instead of a dive_site pointer. Make it call centerOnDiveSite(). Make both this function and reloadMapLocations() Q_INVOKABLE as these are going to be called from QML. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
APK: the build works but running the APK results in "cannot find a plugin named: googlemaps". edit: looks like |
4729802
to
726ad51
Compare
Tested on device, after hacking through the build problem on my local desktop. Some review comment:
|
good thing it doesn't crash at least.
easy to do.
the only fix i see is to make the zoom animation very slow. tiles are loaded slower than the map requesting them. then again how can you predict how fast is one's internet, as that is the cause for the flashing? i see similar behavior with google maps, except it's not as visually striking.
i don't see any good solutions without enabling multi selection and multiediting.
my |
I'm not sure it is limited by network loading speed. I looked at the video in slow speed, and see that the tile data (the scale) is the same before and after the first full screen white flash. In addition, a fast zoom out on the google maps client on my device looks very different
As the dive list is ordered in a descending way, and users might tend to be more interested in recent dives compared to dives long ago, it might be better to select the last dive instead of the first. My oldest dives in Subsurface are 10 years old, and I currently have exact 1000 dives in Subsurface, so a random click on a flag brings me back multiple years in the list (most of the time). This does not feel right.
I currently have no fix, I just hacked around on the command line. Maybe tomorrow morning some time to make a commit for it. |
so once the tiles have loaded for a certain area the flashing can be seen again over the same area afterwards? i have to say that i don't have a good fix for that either way.
understood, this makes sense and i would try to get the latest single dive instead.
ok, if you think you wont have the time for this just send me your hack now so that i can have a look. |
This was what I did from the command line to get the plugin compiled and installed. Notice that this installs to my local Qt tree, not to the Subsurface install-root.
output of qmake -query
|
build system integration for both Android and iOS always is a major pain with new dependencies. That's fundamentally broken on both platforms. I continue to be completely under water with work and real life - and will be at least through mid next week. All this aside, a few comments on the discussion here:
|
it's hard for me to tell which is right as a non-user of the mobile app, so maybe we need feedback from more users here. what Jan proposed seems like a good and easy to implement solution - always pick the latest dive chronologically. |
i will try to get the APK building via Travis this weekend. |
The mobile version is limited as it does not support dive list selection of multiple dives and editing multiple dives. Also the dive list on mobile does not follow the same indexing as the desktop version dive list. Use the SUBSURFACE_MOBILE macro and for: - centerOnDiveSite() either deselect map markers or center on a single one (never on a rectangle like the desktop version) - selectedLocationChanged() and selectVisibleLocations() return a list of single dive ID Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Add the setCurrentDiveListIndex() wrapper for: diveListView.currentIndex = idx wich also makes it possible to disable the scroll animation when selecting dive list indexes which are too far apart. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
The signal to emit is selectedDivesChanged() and it accepts a list if diveIds. The 'nSelectedDives' counter is redundant. Also expose the 'map' and 'mapHelper' objects as aliases. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
The Page object has the following functionality: - reloadMap(): reload all map markers. - centerOnDiveSiteUUID(): center the map on a dive site uuid. - centerOnLocation(): the map on a latitude, longitude in decimal. - Select a dive list entry based on a marker selected on the map via diveList.setCurrentDiveListIndex() Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
1) QML files 2) Map widget specific icons 3) The Breeze map-globe.svg icon Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
showMap() uses a location to open Google Maps in a browser. Make showMap() a generic function to push the mapPage on the view stack. Update the calls to this function from child widgets and pages. Also either call mapPage.centerOnLocation() or mapPage.centerOnDiveSiteUUID() depending if the caller wants the map to center on a dive site or on map coordinates. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This action uses the Breeze icon "map-globe.svg" and calls showMap(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
When the slot pageStack.onCurrentItemChanged() is reached make sure that the stackView becomes non-interactive. This prevents swiping left on the map to "go back". Also, always reload the map markers when the map becomes visible. This is not optimal and instead something in the lines of: DiveList.model.onChanged() is a much better solution. Ideally the map reload should happen on dive removal, dive addition, dive edits and sync from cloud. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
6750dea
to
4578b49
Compare
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
update:
|
Tested my own compile on device. All working. Also did a quick read over the code changes and all looks good to me. So, approved and for me ready to merge. And with the current behavior (chronological last) of selecting a flag on the map, we even have (primitive) search capability for the last dive on that location. I like that as well. |
Reading through the code it looks all good. This also needs to be added for iOS - but that shouldn't stop us from adding it to master and releasing a new Android beta in the meantime. |
Describe the pull request:
Pull request long description:
this PR enables the map widget on mobile. it is placed in a Kirigami Page and it's possible to
navigate to the page using these methods:
the map is the same as on the desktop version with a few limitations, like:
the mobile version does not allow multi-selection, thus only a clicked marker is selected.
a single dive, rather than zooming on a rectangle of dives.
Changes made:
ifdef
wrapped modifications inmapwidgethelper
to comply with the limits of the mobile version.MapPage
is activeRelated issues:
Closes #1037
Additional information:
QtLocation
,QtPositioning
modules need extra deployment steps.Release note:
- Mobile: enable the built-in map widget
Documentation change:
Requires work flow updates in the documentation to include the map widget navigation - e.g.
screenshots.
Mentions:
@dirkhh @janmulder @atdotde @glance- @willemferguson