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

geo: intent does not change map location #3580

Closed
mnalis opened this issue Dec 9, 2021 · 9 comments
Closed

geo: intent does not change map location #3580

mnalis opened this issue Dec 9, 2021 · 9 comments
Assignees
Labels

Comments

@mnalis
Copy link
Member

mnalis commented Dec 9, 2021

SC implemented geo: intent back in #190 - however (as noted by @smichel17 in #426 (comment)) while it does seem to open SC when it is selected in list of supported apps, it does not seems to position SC at specified coordinates (instead SC seems to remain at last coordinates it was on). Correct behaviour should be that SC positions to specified geo: location.

How to Reproduce

  • open some other mapping app like OsmAnd
  • click an share geo: button in it
  • select StreetComplete in the list
  • StreetComplete v38.1 opens, but does not position to location that was selected in OsmAnd

Note: the bug is reproducible with vanilla 38.1, however if I try to share to @Helium314 fork v34.0-beta1 version (that I also have installed, in parallel) it seems to change position fine there. So perhaps something broke between those versions?

Versions affected
SC v38.1, Android 10

@mnalis mnalis added the bug label Dec 9, 2021
@matkoniecz

This comment has been minimized.

@mnalis

This comment has been minimized.

@matkoniecz

This comment has been minimized.

@matkoniecz
Copy link
Member

And now for actually useful comment.

Note that in v34.0-beta1 this works only when "follow current location" is disabled, otherwise move is immediately undone. But it works in such case.

@HolgerJeromin
Copy link
Contributor

This is a recurring regression:
#2227, #1426

@matkoniecz
Copy link
Member

bisecting between v34.0-beta1 and current version found 5820b40 as point where it reappeared

@smichel17
Copy link
Member

smichel17 commented Dec 10, 2021

private fun handleGeoUri() {
if (Intent.ACTION_VIEW != intent.action) return
val data = intent.data ?: return
if ("geo" != data.scheme) return
val geo = parseGeoUri(data) ?: return
val zoom = if (geo.zoom == null || geo.zoom < 14) 18f else geo.zoom
val pos = LatLon(geo.latitude, geo.longitude)
mainFragment?.setCameraPosition(pos, zoom)

Perhaps the FragmentContainerView means the MainFragment is initialized late and still null at the time of this call?

This is a recurring regression: #2227, #1426

Probably a good idea to write a test or two for it

@matkoniecz
Copy link
Member

Probably a good idea to write a test or two for it

Personally I have no good idea how to setup something automatically testing this

@westnordost
Copy link
Member

In StreetComplete, there are not any UI tests. I think UI tests are not worth the effort. It is likely that you identified the issue correctly. Not sure how this could best be fixed though... adding a delay?

@westnordost westnordost self-assigned this Dec 14, 2021
westnordost added a commit that referenced this issue Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants