StaticMap
POSThttps://api.uber.com/maps/beta/staticmap
Use Case
The StaticMap endpoint returns a static map image with annotations (origin, destination, route lines) as a URL.
Authorization
OAuth 2.0 Bearer token with the maps-apis scope.
Request Parameters
| Name |
Type |
Description |
Required? |
width |
string |
The width of the map in pixels. |
Yes |
height |
string |
The height of the map in pixels. |
Yes |
annotations |
array |
A list of markers to be added on the map. |
No |
polylines |
array |
A list of polylines (route lines) to be added on the map. |
No |
Annotation Parameters
| Name |
Type |
Description |
Required? |
id |
string |
The id of the location, as returned by other search based endpoints |
Yes |
type |
string |
The type of annotation (origin, destination, etc). |
Yes |
Annotation Type Options
| Name |
Type |
Description |
STATIC_MAP_ANNOTATION_TYPE_ORIGIN |
string |
Origin or starting point. |
STATIC_MAP_ANNOTATION_TYPE_DESTINATION |
string |
Destination or ending point. |
STATIC_MAP_ANNOTATION_TYPE_WAYPOINT |
string |
Intermediate stop. |
Polyline Parameters (Coordinate)
| Name |
Type |
Description |
Required? |
latitude |
double |
Latitude (-90,90). |
Yes |
longitude |
double |
Longitude (-180, 180). |
Yes |
Example Request
curl -X POST \
-H "authorization: Bearer $UBER_TOKEN" \
-H 'content-type: application/json' \
https://$api_url/maps/beta/staticmap -d
'{
"width": 512,
"height": 256,
"annotations": [
{
"id": "u01:02:ChIJo5-BWTS3j4AR1qXcqk2iILo",
"type": "STATIC_MAP_ANNOTATION_TYPE_ORIGIN"
},
{
"id": "u01:02:ChIJA2dtP4e3j4ARh1s4PrN6vRc",
"type": "STATIC_MAP_ANNOTATION_TYPE_DESTINATION"
}
],
"polylines": [
{
"coordinates": [
{
"latitude": 37.3940796,
"longitude": -122.0804791
},
{
"latitude": 37.3771209,
"longitude": -122.0335441
}
]
}
]
}'
Response body parameters
| Name |
Type |
Description |
Required? |
url |
string |
The URL to static map image. |
Yes |
Status-code: 200 OK
{
"url": "https://static-maps.uber.com/map?width=512&height=256&marker=lat%3A37.3940796%24lng%3A-122.0804791%24icon%3Ahttps%3A%2F%2Fcn-geo1.uber.com%2Fstatic%2Fmobile-content%2Fmapdisplay%2Forigin%402x.png&marker=lat%3A37.3771209%24lng%3A-122.0335441%24icon%3Ahttps%3A%2F%2Fcn-geo1.uber.com%2Fstatic%2Fmobile-content%2Fmapdisplay%2Fdestination%402x.png&polyline=color%3A0xFF000000%24width%3A3%24enc%3A%7DofcF%7CybhV%7ChBidH&signature=iDP3-1Yj_AKRrMiX1hwhdHn7bv4="
}