MapBox dynamic change

Hello,

I have a question regarding the dynamic change of the MapBox map while the Retool application is running. I noticed that MapBox has the ability to run JS Query every time the user, for example, clicks on a point on the map.

Is it possible using JS Query to cause a change in the same map, for example, after clicking, add a new point to the map at coordinates 0, 0?

And also, is it possible to add more events, for example, to create new points on the map when you click on the map?

Thank you!

Hello,
you may create viriables to hold the value of point and GeoJSON
image

and add event handler to the MapBox

But it seem not click event handler by now.

Thank you, @AnsonHwang! The idea of using a separate variable is great. It is much better to change the variable, rather than add string values to existing GeoJson. Maybe someone else knows about the clicking on the empty space of map.

I have noticed that the Map can react on Hovering. So maybe there is a feature to get a click event not like on a map, but on HTML element of Map, so it will send current coordinates of the mouse to the separate variable.

1 Like

We are tracking a feature request for this behavior!

Hi, yall. I need users to be able to click the map module and on click create a new marker or pass coordinates of a click to the table. Sounds like the very basic functionality of any map tiler.

Yet I'm struggling to figure a way to do it.

Advice?

Cheers!

Hi @Scottsky, I merged your topic here. :slightly_smiling_face:
We added your +1 to the request and we'll update you with any news from our devs.

~ Reopened the topic to collect more +1s for this FR.