https://www.mapquestapi.com/staticmap/v5/map
Response Formats | jpeg, jpg, jpg70, jpg80, jpg90, gif, png |
---|---|
Authentication | Yes (Requires Key) |
Rate Limited | Yes |
The API Key, which is needed to make requests to MapQuest services.
Specifies the dimensions of the map image, in pixels. If you want a retina image, append @2x to the parameter after the comma-separated integers. If you just want retina resolution at the default size, just append @2x to the size parameter.
Minimum | Maximum | |
---|---|---|
Width | 170 (pixels) | 1920 (pixels) |
Height | 30 (pixels) | 1920 (pixels) |
size=width,height (size=500,400)
size=width,height@2x (size=500,400@2x)
A center point for the map image. Can be either a single line address or a latitude,longitude pair.
Note: boundingBox
will override center.
center=40.039401,-76.307078
center=Denver,CO
If a center point is not desired, a bounding box can be used to specify the area of the map to be shown. This parameter takes a latitude,longitude pair as an upper left corner bound and one for the lower right. It then creates a map based on those bounds given.
Note: boundingBox
will override center.
boundingBox=40.06,-76.73,39.96,-76.30
In some cases when doing a boundingBox, changing the margin can adjust the zoom level accordingly when you are out of the bounds of the map.
margin=100
The zoom level of the map. Integers between 0 and 20.
zoom=7
The image format of the map. Available formats are png, jpeg, jpg, jpg70 (70% quality), jpg80 (80% quality), jpg90 (90% quality), and gif.
format=png
The type of base map tiles on the map. The options are map, hyb, sat, light, and dark.
type=dark
Show a scale bar on the top of the map.
scalebar=true
To change the position of the the scale bar on the map, append a single pipe character
| followed by a position string to the end of the scalebar
parameter. See the example below.
scalebar=true|bottom
GET
https://www.mapquestapi.com/staticmap/v5/map?key=KEY¢er=Boston,MA&size=600,400@2x
GET
https://www.mapquestapi.com/staticmap/v5/map?key=KEY¢er=San+Francisco,CA&zoom=10&type=hyb&size=600,400@2x
A list of locations you want to put on your static map. Locations can be Latitude,Longitude Coordinates or a single line address.
Two pipe characters || separate locations in the list.
locations=Denver,CO||Boulder,CO||Broomfield,CO
locations=Denver,CO||Boulder,CO||39.9205,-105.0867
A single pipe character | followed by a string after a location is used to customize the icon for that location. Refer to the Getting Started guide for more information about all the possible custom MapQuest icons. In addition, external icons can also be used by entering the URL after the |. To hide an icon, enter "none" after the |.
locations=Denver,CO|marker-red||Boulder,CO|marker-green
locations=Denver,CO|/documentation/assets/img/apple-icon-152x152.png
locations=Denver,CO|none
When locations are too close to each other they can be lost or partially overlapped.
With declutter set to true, the service finds the best possible decluttered position for each location and places it on the map so that it does not overlap with any other location.
declutter=true
By default, a dark gray marker is placed on every location in your list. You can use
the defaultMarker
parameter to override this behavior. You can also set the
default marker to none if you don't want markers highlighting the locations on
your map. Refer to the Getting Started
guide for more information about all the possible custom MapQuest icons.
defaultMarker=marker-red-lg
defaultMarker=circle-3B5998-sm
defaultMarker=none
GET
https://www.mapquestapi.com/staticmap/v5/map?locations=New+York,NY||Buffalo,NY||Rochester,NY&size=600,400@2x&key=KEY
GET
https://www.mapquestapi.com/staticmap/v5/map?key=KEY&locations=San+Francisco,CA||San+Jose,CA|marker-lg-A20000-D51A1A||Sacramento,CA&size=@2x&defaultMarker=marker-sm-22407F-3B5998&size=600,400@2x
Sometimes you might want to describe what is visible on a map to add context. By default the banner parameter will show a dark gray background with white text at the bottom of the image.
banner=Coffee+Shops
Banners can be customized with three different sizes, two positions, background color, and text color. To customize a banner, add a single pipe character | followed by an options string after the banner's text string. Multiple options can be separated by a dash -. Below are some example banner customizations.
Banner Size: sm (small), md (medium), lg (large)
banner=Coffee+Shops|lg
Position: bottom, top
banner=Coffee+Shops|top
Banner Color: Any Hex Value
banner=Coffee+Shops|A0021B
Text Color: Any hex value
(requires banner color to be defined first).
banner=Coffee+Shops|A0021B-000000
Combining Options
banner=Coffee+Shops|lg-top-A0021B-000000
GET
https://www.mapquestapi.com/staticmap/v5/map?locations=New+York,NY||Buffalo,NY||Albany,NY&size=600,400@2x&key=KEY&banner=Large+Cities+in+New+York
The starting point of a route request. The start parameter can take a location as either a single line address or a latitude,longitude coordinate pair.
A single pipe character | followed by a string after a location is used to customize the icon for that location. Refer to the Getting Started guide for more information about all the possible custom MapQuest icons. In addition, external icons can also be used by entering the URL after the |. To hide an icon, enter "none" after the |.
start=40.039401,-76.307078
start=Denver,CO
start=Denver,CO|flag-start
The ending point of a route request. The end parameter can take a location as either a single line address or a latitude,longitude coordinate pair.
A single pipe character | followed by a string after a location is used to customize the icon for that location. Refer to the Getting Started guide for more information about all the possible custom MapQuest icons. In addition, external icons can also be used by entering the URL after the |. To hide an icon, enter "none" after the |.
end=41.039401,-76.307078
end=Boulder,CO
end=Boulder,CO|flag-end
Specifies a session ID from a route made with the MapQuest Directions API.
session=SESSION_ID
This parameter specifies that the route should be geodesic (the shortest distance between two points on a sphere) instead of a driving route. This is useful when charting plane routes, long routes, or if you don't want to use our Directions API. Default routeWidth for an arc route is 2.
routeArc=true
The routeWidth parameter controls the pixel width of the route. The width must be an integer.
routeWidth=5
Specify a 24-bit or 32-bit hex color, or a comma-separated rgb or rgba color for the route.
When a 32-bit hex value is specified, the last two characters specify the 8-bit alpha transparency value. This value varies between 00 (completely transparent) and FF (completely opaque).
routeColor=812DD3
routeColor=812DD396
routeColor=10,100,200
routeColor=10,100,200,150
GET
https://www.mapquestapi.com/staticmap/v5/map?start=New+York,NY&end=Washington,DC&size=600,400@2x&key=KEY
GET
https://www.mapquestapi.com/staticmap/v5/map?start=San+Francisco,CA&end=Tokyo,JP&routeArc=true&size=600,400@2x&key=KEY
Specifies the inclusion of traffic data such as flow (the colored lines on streets), incidents, and construction for the requested map location.
A single pipe character | is used to separate the accepted values. You can have any combination of these options set for a traffic request.
Accepted values are:
traffic=flow|con|inc
traffic=flow
GET
https://www.mapquestapi.com/staticmap/v5/map?center=Los+Angeles,CA&zoom=10&traffic=flow|cons|inc&size=600,400@2x&key=KEY
The shape parameter defines a set of locations connected by a path to overlay above the map. The shape parameter can take locations as either a single line address or a latitude,longitude coordinate pair.
shape=shapeStyles|location1|location2|...
shape=40,-76|39,-74
shape=Denver,CO|Boulder,CO
shape=40,-76|39,-74|39,-76|40,-76
shape=Denver,CO|Boulder,CO|Golden,CO|Denver,CO
shape=radius:100km|40.039401,-76.307078
shape=radius:10mi|Denver,CO
For circle shapes, the radius:
value must be specified. The units of
radius
is either mi (miles) or km (kilometers). If no unit is specified,
the default unit is km.
Instead of a series of locations, you may instead declare a path as an encoded shape by using the
enc:
prefix within the location declaration. You must also define the
compressionType from the list below.
Note: For compressed shapes, the enc:encoded_data
must be the
last value in the shape parameter value assignments.
shape=shapeStyles|compressionType|enc:encoded_data
shape=cmp|enc:_ocsF~vznM~hbE_seK
shape=cmp6|enc:__lhkA~nt}oC~b`|@_gayB
shape=delta|enc:40100000,-80000000,-200000,0,100000,100000,0,-200000
Shapes can be customized with border weight, border color, and fill color. The set of style descriptors is a series of value assignments separated by the pipe (|).
weight:
(optional) specifies the thickness of the path in pixels. If
no weight
parameter is set, the path will have a default thickness of 3
pixels.
border:
(optional) specifies the color of the path in a 24-bit
(example: 812DD3) or 32-bit (example: 812DD3CC) hex color. If no border
parameter is set, the path will have a default color of 5882fa.
fill:
(optional) specifies the fill color of a polygon or circle in a
24-bit (example: 812DD3) or 32-bit (example: 812DD3CC) hex color. If no
fill
parameter is set, the fill will be transparent.
shape=weight:2|border:ff0000|40,-76|39,-74
shape=weight:5|fill:0000ff80|border:000000|40,-76|39,-74|39,-76|40,-76
GET
https://www.mapquestapi.com/staticmap/v5/map?key=KEY&shape=Disney+World%7Cwidth:7mi|weight:4&shape=28,-81|28,-80.25|27.25,-80.25|27.25,-81|28,-81|fill:ffffff88|border:ff000088&shape=border:333333|weight:5|cmp|enc:encoded_data&size=600,400@2x
When using single-line addresses, the following formats are acceptable.
Format | Example |
---|---|
city (AA5), state (AA3) | Denver, CO |
city, state, postalCode | Denver, CO, 80202 |
postalCode | 80202 |
street, city, state | 1555 Blake St, Denver, CO |
street, city, state, postalCode | 1555 Blake St, Denver, CO 80202 |
street, postalCode | 1555 Blake St, 80202 |
Latitude,Longitude | 39.750307,-104.999472 |