I have a form on a webpage that has a map the user can click on to populate the form's latitude and longitude fields. See it live.
I have an empty dataset created in Mapbox Studio and have created an accessToken which has the secret
datasets:write
scope selected, as seen in this screenshot.
Challenge: My form will generate a GeoJSON string out of the form fields, which I want to append to my mapbox dataset via a call to mapbox's API. The dataset should capture and show all locations submitted on that form.
How do I go about it? More specifically, if I have my username, dataset id and my accessToken, what should be the syntax of my form's submit action?
References:
- this github discussion at a similar project that successfully got a GPS Logger app to post to a mapbox dataset via a server script. (server side script was needed there to be listening for the app and posting stuff to mapbox that the app couldn't; I believe we can bypass that in a form's case)
- Mapbox API documentation for datasets that I haven't been able to properly understand and apply to my case.