# Polylines from JSON string?

**URL:** <https://community.thunkable.com/t/polylines-from-json-string/53936>\
**Category:** Questions about Thunkable X\
**Created:** [October 27, 2018, 8:58pm UTC](https://community.thunkable.com/t/polylines-from-json-string/53936 "2018-10-27T20:58:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leo2](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@Leo2](https://community.thunkable.com/u/Leo2)\
**Post date:** [October 27, 2018, 8:58pm UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/1 "2018-10-27T20:58:09Z")

</div>

Is it possible to draw polylines with points from a JSON string [like in Android Classic](https://docs.thunkable.com/thunkable-classic-android/create/components/location/google-maps)?

If so, how?

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [October 28, 2018, 8:49am UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/2 "2018-10-28T08:49:22Z")

</div>

Yes. Will it work?

![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/4/2411308d3670701eb008a4aed1eb21ba85328f90.png)

---

<div class="post-metadata">

**Author:** ![Leo2](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@Leo2](https://community.thunkable.com/u/Leo2)\
**Post date:** [October 29, 2018, 3:07am UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/3 "2018-10-29T03:07:19Z")

</div>

Thanks, I saw that block, but the text block doesn’t connect to that.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [October 29, 2018, 8:26am UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/4 "2018-10-29T08:26:55Z")

</div>

Why do you need to connect a text block to this block? A list with coordinates or a variable with the desired data type can be connected to this block.

---

<div class="post-metadata">

**Author:** ![Leo2](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@Leo2](https://community.thunkable.com/u/Leo2)\
**Post date:** [October 29, 2018, 8:31am UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/5 "2018-10-29T08:31:38Z")

</div>

There are about 350 points in the polyline. I don’t want to enter them one by one, but in a Json string.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [October 29, 2018, 8:35am UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/6 "2018-10-29T08:35:39Z")

</div>

From the text string, you can create a list of data in the required format.

[https://docs.thunkable.com/thunkable-cross-platform/create/components/location/map#add-polyline](https://docs.thunkable.com/thunkable-cross-platform/create/components/location/map#add-polyline)

---

<div class="post-metadata">

**Author:** ![Leo2](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@Leo2](https://community.thunkable.com/u/Leo2)\
**Post date:** [October 29, 2018, 8:42am UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/7 "2018-10-29T08:42:11Z")

</div>

I think I get it, thanks. Will report back here with the result.

---

<div class="post-metadata">

**Author:** ![Leo2](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@Leo2](https://community.thunkable.com/u/Leo2)\
**Post date:** [October 29, 2018, 8:57am UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/8 "2018-10-29T08:57:14Z")

</div>

Now I feel like an idiot. 🤪  
There seems to be no ‘create list with’ block… There is only the create list with repeated items block.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [October 29, 2018, 12:19pm UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/9 "2018-10-29T12:19:24Z")

</div>

To improve your mood, a simple example with JSON data for a polyline. 🕶  
I also show the magic of turning a string into a numeric type.

![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/f/ff41916736873ede2e5329746f66d3919b8f5741.png)

---

<div class="post-metadata">

**Author:** ![Leo2](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@Leo2](https://community.thunkable.com/u/Leo2)\
**Post date:** [October 30, 2018, 6:17am UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/10 "2018-10-30T06:17:28Z")

</div>

That’s fantastic. Thanks for your help!

OT: it’s strange how the json format differs. In Android Classic only `[[mydata],[otherdata]]` will work, not `[{mydata},{otherdata}]`

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [October 30, 2018, 2:06pm UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/11 "2018-10-30T14:06:23Z")

</div>

Yes, in Thunkable X uses an array of objects, and Thunkable Classic uses a multi-dimensional array.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:54am UTC](https://community.thunkable.com/t/polylines-from-json-string/53936/12 "2024-11-08T11:54:53Z")

</div>


