Mapbox UI builder control

Hi there, I’m using the mapbox control and I’m able to get it to search for an address and it pans to the location, however I try to get the coordinates from the pan action and I’m finding the mapbox control doesnt center to the address I searched, its usually 20-30 kilometers away (to the right). Anyone have suggestions on how to pull the exact coordinates from the address being searched? As well as the placename if possible?

I am doing the following:

The first call is for the distrance, second call is for the placename, the 3rd call is just for debugging

Hello @Joel_Maclean1

I see that in the block “Convert to text” you put text to the property “object”. Maybe there are some errors related to this?

Regards

Hi, @Joel_Maclean1

You can use Geocoding API which converts location text into geographic coordinates and vice versa.
Can you please show me how you get the coordinates?

Kind Regards,
Roman

Hey @Roman_Skrypak yes I am just using the On Pan Event, but its not ideal. It would be more preferrable to have the user click in the map to set a pin and use that address/coordinates.

Hi, @Joel_Maclean1

Should work, otherwise to check if the map moved to your coordinate use ‘get Center’ action and compare the coordinates.


In this example, we use Mapbox on Click event, which stores all points, updates pins on the map and moves the map where you clicked.

Kind Regards,
Roman