NEW UPDATE: New function to encode into a string a list with paired latitude and longitude!
Hello Thunkers! Here I present to you my first extension ever made for decoding and encoding polylines from Google Maps API. First, I found the Encoding Polyline Algorithm Format and tried to reverse it using blocks, but then I found the Jeffrey Sambells’ method and I felt like learning how to make an extension.
So this is it! I hope you find this useful and if you find how to make it better, please let me know so I can learn from it.
This extension was made in colaboration with Diego Pedroza.
Tool developed by Carlos Pedroza to decode and encode Polylines from Google Maps API based on Jeffrey Sambells’ method and Sciolist’s method.
Decode: Decodes polyline and returns a list of paired lat/lng, based on Jeffrey Sambells’ method.
Encode: Encodes a list of paired lat/lng using the the Encoded Polyline Algorithm.
EncodeLatORLng: (Deprecated, not available in current version).
EncodePoint: (Deprecated, not available in current version, use Encode instead).
In order to test it, this example decodes this polyline
[email protected] and later succesfully encode it back.
This homework is done!
I figured how to use at some point YailLists but I haven’t figured out how to manage a list of a list (list of paired lat/lng). It is homework! But, meanwhile, here I present a workaround that works:
This is extension is free and opensource available at: GitHub
Feel free to donate:
Also, you can donate to the App Inventor launch on iOS crowfunding campaign!
- Sep 1st, 2017: Initial release.
- Sep 2nd, 2017: Added EncodeLatORLng method.
- Sep 5th, 2017: Added EncodePoint method.
- Nov 24th, 2017: Added Encode list of paired lat/lng and EncodePoint and EncodeLatOrLng deprecated.
Best Regards from ,