I have a select2 option where a user can select a Continent, Region, Country, City or Airport. I integrated mapbox to add markers to the map on selecting a location.
In case of Country and continent selection I would like to select the whole country/continent instead of just a marker.
I tried using the Mapbox Geocoding API like https://api.mapbox.com/geocoding/v5/mapbox.places/germany.json?types=country&access_token=**** but I noticed it only returns a 'Point' coordinates.
I would like to use a service where I provide the country/continent name and it returns a polygon with all the border coordinates in order to be able to highlight on the polygon on the map.
Does mapbox have a built-in service for such functionality? Or do I need to use a third-party service or json file?