# Problem with adding a polygon

**URL:** <https://community.thunkable.com/t/problem-with-adding-a-polygon/360409>\
**Category:** Questions about Thunkable X\
**Created:** [December 10, 2019, 6:10pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409 "2019-12-10T18:10:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/chris/32/78883_2.png) [@Chris](https://community.thunkable.com/u/Chris)\
**Post date:** [December 10, 2019, 6:10pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/1 "2019-12-10T18:10:01Z")

</div>

Hi,

I recently ran into a huge problem regarding the maps component. I need to draw a cities boundary as polygon but when I tried to copy and paste the geocode.json into Thunkable I realized that for whatever reason the text will just be cut off. I then tried to upload the .json file and access it in the blocks but that is not possible since entering = “city.json” just results in a text that says “city.json” and does not access the file…

 ![get_image.py](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/e/3e116acd00a3d8b849a326b89ffe5fcdd6aee4b2.png)

Any solutions for this? Also I am wondering how I could tell if the user is within the polygon… I have not yet figured out a way but I couldn’t even try since I got stuck at importing the data already 😕

Best, Chris

---

<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:** [December 10, 2019, 7:01pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/2 "2019-12-10T19:01:59Z")

</div>

Hello,

For experiments, I need json data. If you give me an example of such data or a way to get it, then I will look at the solution.

Alex

---

<div class="post-metadata">

**Author:** ![Chris](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/chris/32/78883_2.png) [@Chris](https://community.thunkable.com/u/Chris)\
**Post date:** [December 10, 2019, 7:10pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/3 "2019-12-10T19:10:59Z")

</div>

Here’s an example of what I am working with:

[wien\_geo.json.zip](https://community.thunkable.com/uploads/short-url/35SMYH7MVDEKtdyyXjABq8CNWPx.zip) (22.1 KB)

---

<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:** [December 10, 2019, 7:11pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/4 "2019-12-10T19:11:55Z")

</div>

Good

---

<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:** [December 10, 2019, 7:50pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/5 "2019-12-10T19:50:19Z")

</div>

Check it

[https://x.thunkable.com/projects/5defeb44901bbf03b5387d0a/project/properties/designer/](https://x.thunkable.com/projects/5defeb44901bbf03b5387d0a/project/properties/designer/)

---

<div class="post-metadata">

**Author:** ![Chris](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/chris/32/78883_2.png) [@Chris](https://community.thunkable.com/u/Chris)\
**Post date:** [December 10, 2019, 7:58pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/6 "2019-12-10T19:58:07Z")

</div>

Thank you for this 🙂 what I don’t get is why this still works even tough when you compare the text block with the original it seems like it is cut off somewhere in between. The original ends with `]]]}]}` while in the text block it ends with

 ![Bildschirmfoto 2019-12-10 um 20.48.30](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/4/147c4d81355fb1b6ac734d0e897be72d5c8c6cd8.png)

So since your example is working I assume this is only a displaying bug?

Best, Chris

---

<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:** [December 10, 2019, 8:00pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/7 "2019-12-10T20:00:54Z")

</div>

In fact, nothing is cut off. I work with tens of thousands of records without problems. Yes - displaing bug )))

---

<div class="post-metadata">

**Author:** ![Chris](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/chris/32/78883_2.png) [@Chris](https://community.thunkable.com/u/Chris)\
**Post date:** [December 10, 2019, 9:10pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/8 "2019-12-10T21:10:26Z")

</div>

Thanks for pointing that out. I hope Thunkable will fix the display problem with the text block but glad it still works anyways. Do you have an idea how I could get if the gps position is within a polygone?

also may I ask how you did the “set \_list” without creating the variable first? When I try putting this blocks in my project I can only choose an existing variable…

cheers, Chris

---

<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:** [December 11, 2019, 2:42pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/9 "2019-12-11T14:42:37Z")

</div>

1. To determine that a point is inside the polygon, try to look at various algorithms. I did not work with this.

2. To create a variable, I add a function block to the screen, add a parameter to it and then delete the function - the variable from the function parameter becomes available in the palette

---

<div class="post-metadata">

**Author:** ![Chris](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/chris/32/78883_2.png) [@Chris](https://community.thunkable.com/u/Chris)\
**Post date:** [December 11, 2019, 5:02pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/10 "2019-12-11T17:02:47Z")

</div>

> [@actech](#):
>
> To create a variable, I add a function block to the screen, add a parameter to it and then delete the function - the variable from the function parameter becomes available in the palette

and is there a benefit of doing so?

---

<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:** [December 11, 2019, 5:08pm UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/11 "2019-12-11T17:08:00Z")

</div>

The benefits are enormous!

1. The variable from the function parameter works a thousand times faster than any global variable
2. The variable from the function parameter has a link mechanism when working with objects, which makes working with objects easier and does not need to be rewritten as in the case of global variables
3. The variable from the function parameter can be made local
4. The variable from the function parameter did not have such problems and bugs as global variables. You probably remember how, after the release of Live 120, users stopped working for this reason? I had no such problems, because I try not to use global blocks of variables.

---

<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:46am UTC](https://community.thunkable.com/t/problem-with-adding-a-polygon/360409/12 "2024-11-08T11:46:28Z")

</div>


