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

dart: Flutter web gives completely wrong results when decoding polyline #26

Open
cedrichansen opened this issue Oct 24, 2020 · 3 comments

Comments

@cedrichansen
Copy link

cedrichansen commented Oct 24, 2020

Decoding polylines on flutter web is completely wrong.

Using the provided example from https://pub.dev/packages/flexible_polyline, running on android works just fine and prints out the expected results

List<LatLngZ> decoded = FlexiblePolyline.decode("BFoz5xJ67i1B1B7PzIhaxL7Y");

results in the following on android/ios


 LatLngZ [lat=50.10228, lng=8.69821, z=0.0]
 LatLngZ [lat=50.10201, lng=8.69567, z=0.0]
 LatLngZ [lat=50.10063, lng=8.6915, z=0.0]
 LatLngZ [lat=50.09878, lng=8.68752, z=0.0]

But running the exact same code with flutter web gives the following:

LatLngZ [lat=50.10228, lng=8.69821, z=0]
LatLngZ [lat=21524.93849, lng=21483.53215, z=0]
LatLngZ [lat=42999.77359, lng=42958.36446, z=0]
LatLngZ [lat=64474.60822, lng=64433.19696, z=0]

The first address is correct, but subsequent addresses 2-4 are very large
If there are any additional params/options available that fix the decoding scheme based on web vs mobile, that would be an acceptable workaround until a better solution can be found

@cedrichansen cedrichansen changed the title dart: Flutter web gives completely wrong results dart: Flutter web gives completely wrong results when decoding polyline Oct 24, 2020
@ichsan210
Copy link

i have same issue, is the problem have fix?

@cedrichansen
Copy link
Author

I have not found a fix using this package. I have switched to a completely different method, specifically, calling a server of mine which is responsible for getting directions/polyline, using google maps, and communicating that result via http. Not my favourite work around, but it works well for my use case

@VeaaC
Copy link
Contributor

VeaaC commented Jan 3, 2022

Sounds a bit like #52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants