The Radar Static Maps API generates standalone images of Radar Maps that can be easily embedded anywhere an image can be used. These images can be created without the use of Javascript or any additional mapping libraries.
<img>
tags by setting the src
attribute to the Static Maps endpoint.
GET
https://api.radar.io/maps/static
Name | Default | Possible values | Description |
---|---|---|---|
width | none (required) | number | The width of the image in pixels as a number between 100 and 2048 . |
height | none (required) | number | The height of the image in pixels as a number between 100 and 2048 . |
center | none (required, unless markers are provided) | string | The coordinates specified in latitude,longitude format for the center of the map. If center is not provided then the map will be centered to visibly fit all markers in view. |
zoom | none (required, unless bbox, markers, or path are provided) | number | The zoom position of the map which is a number between 1 and 23 . If zoom is not provided then the map will fit the view to the markers. |
scale | 1 | number | The scale or resolution of the map as a number between 1 and 3 . This is useful for high-density displays and will affect the width and height parameters by returning an image that is the product of the width/height and scale. |
style | radar-default-v1 | radar-default-v1 , radar-light-v1 , radar-dark-v1 , CUSTOM_STYLE_ID | The style of the map. One of Radar’s out-of-the box styles, or a custom style ID. See map styles for more details. |
bbox | none | string | The bbox or latitude and longitude bounds of the image. Specified as min_latitude,min_longitude,max_latitude,max_longitude . The image returned will fit the specified bounding box. |
markers | none | string | For rendering markers on the map. See markers for more details. |
path | none | string | For rendering paths on the map. See paths for more details. |
publishableKey | none (required) | string | Your Radar publishable API key. |
markers
parameter that can be configured for rendering one, or many markers on the map.
Each markers parameter is made up of optional markerStyle
sections, and one or more markerLocations
.
latitude,longitude
and are pipe separated.
markerStyle are specified in the following format optionName:optionValue
and are pipe separated. markerStyle have the following options:
color
(string, optional): The color of the image specified as a hex in the following format 0xFFFFFF
or a standard color. The default value if color is not specified is 0x000257
.size
(string, optional): By specifying size:small
as an option, you can render a scaled down version of the marker.icon
(string, optional): The marker image to use. Can be a URL to valid SVG or PNG file, or the ID of custom uploaded marker. The default marker image will be used if not provided.markers
parameters in the request. markers=markerStyle1|markerLocation1|...&markers=markerStyle2|markerLocation2|...
An example request with two different styles is defined below.
path
parameter can be configured for rendering a connected list of coordinates or an encoded polyline.
Each paths parameter is made up of optional pathStyle
sections, an encoded polyline, or one or more pathLocations
.
latitude,longitude
and are pipe separated. Locations must come after the style options.
The locations can also be provided via encoded polyline by specifying enc:
as the option (or enc6:
for a polyline with 6 decimals precision).
optionName:optionValue
and are pipe separated. pathStyle have the following options:
stroke
(string, optional): The color of the path specified as a hex in the following format 0xFFFFFF
or a standard color. The default value if color is not specified is 0x000257
.width
(number, optional): The width of the path in pixels. The default is 3
.border
(string, optional): The color of the path border as a hex in the following format 0xFFFFFF
or a standard color. The default value if color is not specified is white
.borderWidth
(number, optional): The width of the border in pixels. The default is 2
.<img>
using the element’s src
attribute. For instance, if we wanted an image of a map with the following attributes:
radar-default-v1
0x000257
src
.
center
and zoom
to automatically be determined based on the items’ locations.
By omitting the center
and zoom
parameters, the map’s position will be calculated to ensure all markers and paths are visible.
icon:
option as a URL that resolves to a valid .png
or .svg
file.
Note: images will be capped at 64 x 64 pixels.
scale
parameter can be used to increase the resolution of an image, while keeping the same map area visible. For example an image with scale=2
will return an image that is two times the size, but at the same zoom/area.
200x200 @ 1x scale | 200x200 @ 2x scale |
---|---|
![]() | ![]() |