Skip to main content
Use the Maps API to load Radar map styles and tiles into a map renderer, or to request a static map image over HTTP. To put a working interactive map on a page with the Radar SDK, start with Display maps. The base URL is https://api.radar.io. Maps resources live under /maps, not /v1. Map styles are MapLibre style JSON, vector tiles are Mapbox Vector Tile (MVT) with TileJSON metadata, satellite tiles are JPEG, and static maps are PNG.

Authentication

Maps resources require a publishable key. Pass it in one of two ways:
  • As the publishableKey query parameter. Use this for URLs that a browser or map renderer fetches directly, such as an image source or a style URL, where you can’t set headers.
  • In the Authorization header, as with the rest of the API.
This request passes the key as a query parameter:
Secret keys are rejected. A request with a secret key returns 401:
Because the publishable key appears in map URLs, restrict where it can be used. If your project has allowed origins configured, a static map request from a browser whose Referer doesn’t match an allowed origin returns 401 with the message Origin not allowed. See Set up organizations, projects, accounts, and authentication for key types and where to manage them.

Map styles

Returns a map style as a JSON document that conforms to the MapLibre Style Specification. The style references Radar’s tile, font, and sprite URLs with your publishable key already applied, so a MapLibre-compatible renderer needs only this one URL.

Path parameters

Radar provides these styles: A custom style ID is shown in the share dialog when you view or edit the style in the dashboard.

Query parameters

Response

A 200 response is the style document, with Content-Type: application/json. It isn’t wrapped in a meta object. The response is sent with Cache-Control: no-cache, so fetch it each time you create a map instead of storing a copy.

Example

Pass the style URL to a MapLibre-compatible renderer. This example uses MapLibre GL JS. The page must load the MapLibre stylesheet and give the map container a height, or the map renders with zero height.
The same style URL works with other renderers that support the MapLibre style format, including MapLibre Native for iOS and Android. If you use the Radar web SDK, you don’t build this URL yourself. Pass the style ID to the SDK as described in Display maps.

Vector tiles

Radar map data is served as vector tiles in the Mapbox Vector Tile (MVT) format, described by a TileJSON document. Any renderer that supports these two standards can display Radar tiles.
  • Endpoint: GET /maps/data/v1.json or GET /maps/tiles/v1/{z}/{x}/{y}.pbf
  • Authentication: Publishable key
  • Zoom range: Tiles are available for zoom levels 0 to 14. Renderers overzoom the level 14 tiles to display higher zoom levels.
  • Tile coordinates: z, x, and y are integers in the standard XYZ tile scheme.
  • Used by: Display maps
In most integrations you don’t request tiles yourself. The map style points the renderer at these two resources: This request gets the tile metadata:

Satellite tiles

Returns one raster tile of satellite imagery. The radar-satellite-v1 and radar-hybrid-v1 styles reference this resource.
  • Endpoint: GET /maps/satellite/v1/{z}/{x}/{y}
  • Authentication: Publishable key
  • Format: JPEG, 512 by 512 pixels
  • Zoom range: 0 to 18
  • Used by: Display maps
Satellite tiles are available on the Enterprise plan and must be enabled for your project. Contact your Radar account team.
If satellite maps aren’t enabled for your project, the request returns 403:

Static maps

Returns a standalone PNG image of a map. Use a static map anywhere an image works and an interactive map isn’t needed, such as an email, a receipt, or a list thumbnail. No JavaScript or mapping library is required.

Query parameters

If you send markers, path, or bbox and omit center and zoom, Radar positions the map to fit all of them. If you also send center or zoom, your value overrides the fitted one.

Markers

A markers value is a pipe-delimited list of optional style options followed by one or more locations:
Each location is latitude,longitude. Each style option is optionName:optionValue. Style options must come before the locations and apply to every location in that markers value. To draw markers with different styles in one image, repeat the parameter: markers=markerStyle1|markerLocation1&markers=markerStyle2|markerLocation2.

Paths

A path value is a pipe-delimited list of optional style options followed by the line’s locations:
Each location is latitude,longitude. Locations must come after the style options. In place of a list of locations, you can send an encoded polyline prefixed with enc: for 5 decimal places of precision or enc6: for 6 decimal places of precision:
Routing API responses return route shapes as polyline5 or polyline6 strings, which you can pass with enc: or enc6: to draw a route. URL-encode the polyline before you add it to the request URL.

Response

A 200 response is the image, with Content-Type: image/png. Errors are returned as JSON, so an HTML image element shows a broken image when a parameter is invalid. Request the URL directly to read the error message.

Example

This URL requests a map centered on a point, with one marker, at double pixel density:
Use the URL as the source of an HTML image element, and give the element descriptive alternative text. Set the element’s displayed width and height to the unscaled values, here 600 by 400. With scale=2, the returned image has twice as many pixels in each dimension and stays sharp on high-density displays. This URL requests two marker styles and a line. Radar fits the map to them because center and zoom are omitted:

Errors

A 400 response looks like this:

Attribution

Radar map data comes from OpenStreetMap. Keep the Radar and OpenStreetMap attribution visible wherever you display a Radar map. If you build a renderer integration that doesn’t read attribution from the style or TileJSON document, add the attribution to your map yourself.