Conversation
The map-tap handler built the Android intent with Uri(scheme: 'geo', host: ...), which serialises as geo://lat,lng?z=16&q=lat%2Clng. Google Maps tolerates the '//' authority and the encoded comma, but Baidu Maps treats q as search text and Amap fails to open the location. Build geo:lat,lng?q=lat,lng&z=16 (RFC 5870 / Android intent form) instead, via a small pure helper so the exact string is unit-tested. Fixes #1087
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1087.
Problem
Tapping the map in the asset detail panel on Android launched
geo://lat,lng?z=16&q=lat%2Clng. It was built withUri(scheme: 'geo', host: ...), which adds a//authority and percent-encodes the comma inq. Google Maps accepts that, but Baidu Maps readsqas search text and Amap fails to open the location.Change
mobile/lib/utils/geo_uri.dart→geo:lat,lng?q=lat,lng&z=16(the RFC 5870 / Android intent form).exif_map.dartuses it. iOS and the OpenStreetMap fallback are unchanged.Testing
mobile/test/utils/geo_uri_test.dart: checks the exact string, negative coordinates, and parse-back (no authority, literal comma).Actual: 'geo://31.2304,121.4737?z=16&q=31.2304%2C121.4737').dart analyze --fatal-infosanddart formatare clean on the touched files.Not covered