NEW UPDATE! PolylinesTool extension!

extension
googlemap

(Carlos Pedroza) #1


NEW UPDATE: New function to encode into a string a point with latitude and longitude!

Hello Makers! 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.


Description

Tool developed by Carlos Pedroza to decode and encode Polylines from Google Maps API based on Jeffrey Sambells’ method and Sciolist’s method.


Methods

  • Decode: Decodes polyline and returns a list of paired lat/lng, based on Jeffrey Sambells’ method.
    image

  • EncodeLatORLng: Encodes ONLY ONE number lat or lng into a string following the Encoding Polyline Algorithm Format, based on Sciolist’s method.
    image

  • EncodePoint: Encodes a point with latitude and longitud in a list into a string following the Encoding Polyline Algorithm Format, based on Sciolist’s method.
    image

EXAMPLE
In order to test it, this example encodes a list with one point latitude and longitud and later it decodes it back.
image

The reason why I had incorrect decoding and encoding it was because I wasn’t paying attention to an instruction from Encoding Polyline Algorithm Format.

Additionally, to conserve space, points only include the offset from the previous point (except of course for the first point).

That’s why I couldn’t just join every step in a single string and then decode it, or encode each point without encoding only the offset.

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! :rofl: But, meanwhile, here I present a workaround that works:
image


Example .aia

SCREENSHOTS
image

DOWLOADS
Available at: Thunkable
.AIX: com.pedroza.PolylineTools.aix (8,2 KB)

Price

This is extension is free and opensource available at: GitHub
Feel free to donate: http://paypal.me/DrCarlosPedroza


UPCOMING:

  • Video tutorial :smiley:

Best Regards from :venezuela:,
Carlos Pedroza


(Carlos Pedroza) #2

@Kodular feel free to include this extension in your Google Map component!


(Sander Jochems) #3

(Carlos Pedroza) #4

EXTENSION UPDATED!
New function added: Encoding a single latitude or longitud number.


(Carlos Pedroza) #5

EXTENSION UPDATED!
New function added: Encoding a point with latitude and longitude.


(Domi Rami) #6

Very good job,