Cartographr: How to work with the Map Component

Click to Add Markers

One request we hear from Thunkers is the ability to tap on the map component and then add a marker to the location that was just tapped. In this first example we’ll learn how to do just that.


This is the event we need to understand to make everything work. The onPress event has two outputs, coordinate and position - but other than the names of these outputs we don’t know much more about them. Since coordinate seems like the most promising, let’s take a closer look.


Simply trying to display coordinate in a label isn’t much help. If you try this yourself all you’ll see is [object Object]. It mightn’t seem like much, but this clue tells us that coordinate is an object. Thunkable has a whole category of blocks for working with objects so let dig a little deeper.


The first thing to do is create a variable - I’ve called mine coords - to work with the coordinate object. Next, using the get object properties of block we can see that the coordinate object is itself made up of 16 other objects. To save you some of the guess works, the one we’re interested in is nativeEvent.
Let’s repeat this step and investigate the nativeEvent object.

nativeEvent contains a further three objects, action, postion and coordinate.

If we repeat once more we will discover the the coordinate object contains a latitude object and a longitude object. Let’s create two more variables to store the lat and the lng so we can position our marker.

Once we have the values for lat and lng we can place a marker:

If you want to clear the map all you need to do is call the deleteAllMarkers function like this:


Here’s a remix link in case you want to experiment with this yourself.


i have searching on all over thunkable community,
actualy it’s same method… but why on mine is not working…
i always got “null” on nativeEvent…

event i try your remix, & it’s not working…
are thunkable update…? the problem is, i always get nativeEvent:null

help me pls… :sob:

Can you post a link to your project or screenshots? That might help to solve the problem.


@rilo_raspopo +1 for screenshots, it might just be a case of you needing one of the object blocks in your project - or perhaps it might be a typo?

If you show us what you’re trying we’ll be able to point you in the right direction.

same here, I’ve just opened the remix project on my phone and the app quits on the tap event. If I change the event to Long press it has the same problem. Latitude and Longitude seem to be null.

The problem is that the new version on link for remix does not correctly get the latitude and longitude properties. “Get object properties of” returns a string list of property names, but it is treated as an object what’s wrong.




Right, the object has all the properties but values are returned empty as far as I can see. I have created my own project from scratch and ran into the same problem.

I set the right example. Does he work for you?

No it doesn’t work for me. I get a crash (back to login screen)


This is a show stopper for my app idea, should I file a bug report? It seem to be a known problem but I couldn’t find the exact github issue.

@cagedcarpal this first variable should be objCoordinate, right?


Your blocks do not work because you did not look carefully enough at my example. Your blocks use some obscure objCoordinate variable. You tell the computer, my dear, give me the latitude and longitude for no reason. And what result should the computer give?


Oh my… :flushed: sorry

you cannot imagine how happy I am right now! Thanks a lot

1 Like

Indeed, my bad and thanks

1 Like

When working on this tutorial, I’ve come across some technical difficulties. Whenever I click on the map, the lat and lng values don’t return anything, the text remains blank, and no markers are placed. I’ve double and triple checked the code; a picture of it is below:



If i generate JSON from coordinate i see all values are null…

perhabs a BUG?

Has anyone figured out if this error is a bug yet? Or a workaround in the meantime? I am a new Thunkable user and I also ran into this issue.

Just wanted to share, in case anyone else came upon this thread, someone had already reported this bug here - looks like it’s been an issue for several weeks.


@catherinermhenryw1ju @dami_flepp @bobsunscreen

Just a quick update on this, there’s a fix in the works for this which we should be releasing soon. Will be doing a longer post in #Announcements so keep an eye out for that!


A post was split to a new topic: White Screen on Map Press