I am trying to request a static image of a map from Mapbox that has a polygon overlay.
I keep getting a 422 Unknown response.
Below is the geojson structure I have stored in my database field that gets url encoded:
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-98.38294, 47.06659],
[-98.38322, 47.05229],
[-98.36687, 47.05221],
[-98.36675, 47.06654],
[-98.38294, 47.06659]
]
]
},
"properties": {
"title": ""
}
}]
}
Any help would be greatly appreciated.
The error you receive back with this request is a descriptive one:
{"message":"The auto parameter cannot be used with additional location parameters, bearing, or pitch."}
The problem with this request is not your overlay data, but rather the fact that you are attempting to include additional position arguments after auto
(e.g. /auto,13/
) which is not supported.
If you remove ,13
from the request, then the image renders as expected: