FaFre / open_location_code

Apache License 2.0
0 stars 0 forks source link

shortened Plus Code to LatLng not working #2

Open benouarAbdou opened 1 month ago

benouarAbdou commented 1 month ago

i have this position "J8J7+257, Misserghin" that i want to covert to latlng but getting Invalid argument(s): Passed Open Location Code is not a valid code: J8J7+257, Misserghin my code :

var plusCode = olc.PlusCode('J8J7+257, Misserghin'); 
var codeArea = plusCode.decode(); 
print(codeArea);
FaFre commented 1 month ago

Did you try to parse olc.PlusCode('J8J7+257');? Misserghin is not part of a valid pluscode. Probably you will need to split your input strings.

benouarAbdou commented 1 month ago
var plusCode = olc.PlusCode('J8J7+257');
      print(plusCode.isShort());
      var codeArea = plusCode.decode();
      print(codeArea);

isShort returns true

I/flutter (22431): J8J7+257
I/flutter (22431): true

════════ Exception caught by gesture ═══════════════════════════════════════════
Invalid argument(s): Passed Open Location Code is not a valid full code: J8J7+257
════════════════════════════════════════════════════════════════════════════════
FaFre commented 1 month ago

Can you please validate the code with another library? I just tried a random site (https://www.dcode.fr/open-location-code) and it also gives me an validation error.

benouarAbdou commented 1 month ago

That's the place i wanted to add https://maps.app.goo.gl/MHz2Wn1TUwF5Z57g9?g_st=ac Screenshot_2024-09-09-16-20-44-273_com.google.android.apps.maps.jpg And you can see the short form of plus code

FaFre commented 1 month ago

I'm really not sure about this one, but it seems like google maps does something different here, that is not conform with the plus code standard. Even when you enter your code on the official site https://plus.codes/map it will in fact truncate the last digit and show me a place in Greece. Maybe you can try out the official dart code from the official google repo https://github.com/google/open-location-code/ where I also ported the dart code from, and in case there are also problems, raise an issue there.

benouarAbdou commented 1 month ago

Okay i will, thank you for your time

FaFre commented 1 month ago

@benouarAbdou could you solve the issue?

benouarAbdou commented 1 month ago

i didn't try actually , i switched to other problems i was working on on my repositories