Skip to main content
Radar Maps is a cost-effective alternative to Google Maps Platform and Mapbox. For example, here’s a Radar Map displaying a marker for Radar HQ:
You can also check out the maps explorer in the dashboard, or check out a full-page maps demo and store locator demo.

How it works

To use Radar Maps, simply initialize the Radar SDK with your publishable key and specify the container to render the map into. Radar Maps is an extension of the MapLibre GL JS library. See their docs for more customization info.

Getting Started

First, sign up for Radar and get an API key. Then add the Radar SDK to your application.

With npm or yarn

Install the core SDK along with the maps plugin and MapLibre GL JS:
Then import and register the maps plugin in your project:
Note: The maps plugin has a peer dependency on maplibre-gl.

With HTML

Add the core SDK and maps plugin scripts to your html file:
The maps plugin CDN bundle auto-registers with the core SDK when loaded. Then initialize the Radar SDK:

Create a map

Specify the HTML element where you want to render the map, by providing the element’s ID, or the element object itself.

Configuration

Map

You can configure a map with any MapLibre MapOptions. The minimum recommended options are the following:

Functions

The Radar map class also includes some additional functions for handling common map interactions

Styles

Radar provides several out-of-the box map styles:

Custom styles

You can also create a custom map style with Radar Maps Studio. Maps Studio is a visual maps editor available in the Radar dashboard, and supports advanced maps customizations, custom fonts, and custom markers.

Marker

Markers can be used to denote places on the map. Radar Maps support custom marker images, and easily attaching popup’s when a marker is clicked. Radar Marker’s support all options in the MapLibre GL marker options, as well as the following options for the most common scenarios:
Popups can be used to display text or custom HTML at a point on the map, usually upon some user interaction. Radar Popup’s support all options in the MapLibre GL popup options, as well as the following options for the most common scenarios:

Features

Radar Map Features are custom lines and geometries that can be styled and interacted with on the map. The primary format for a map feature is a GeoJSON Feature (Polygon, MultiPolygon, and LineString are supported). Feature ids should be unique, and properties can be used for attaching additional metadata to the features.

Polygon and MultiPolygon

Polygons and MultiPolygons can be added to the map through the map.addPolygon(feature, options) function. The following paint properties for styling.

Line and PolyLine

Lines can be added to the map through the map.addLine(feature, options) function for GeoJSON LineStrings, or map.addPolyline(polyline, options) for encoded polylines. The following paint properties for styling.

Examples

Fit map to markers

Use the map.fitToMarkers() function to center and zoom the map to encompass all the markers on the map. It accepts FlyToOptions as an optional argument. In the example below, clicking the map will place a new marker, and refit the map so all markers are visible. Clicking a marker will remove it.

Add a custom icon

Add a Marker with a custom image to the map by specifying the image URL.

Display a custom popup

Display a popup with customized HTML.

Display a route

Routes can be plotted on a Radar Map as a GeoJSON LineString, or an encoded polyline, both of which are formats provided by Radar’s routing APIs. Polylines can be added to the map with the map.addPolyline function, and accepts an optional precision value (defaults to 6). LineString’s use the map.addLine function. Lines can be styled according to the MapLibre Line Layer properties.

Display a polygon

Polygons or complex shapes can be drawn on a Radar Map by providing a GeoJSON Polygon or MultiPolygon feature to the map.addPolygon function. Polygon features can be styled according to the polygon options highlighted above.

Display a globe

Display a Radar Map with an interactive globe projection. Only available on MapLibre v5 and above.

Change map language

The map display language can be changed by setting the language option to the ISO language code (en), or the browser’s current setting from navigator.language. You can also set language: "local" to use the device language by default.

Compatibility

Radar Maps are built using the Mapbox Vector Tile (MVT) and TileJSON standards, which means they can be used with any SDK that supports these protocols. Below are some alternative libraries that can be used to display Radar Maps.

MapLibre GL JS

The Radar SDK uses the MapLibre GL JS library, which offers some usability enhancements when creating maps. If you want more low-level control over the map behavior, or are migrating from a Mapbox GL JS implementation, you can use the MapLibre library directly. To use a Radar Map with MapLibre, you can use the following Radar URL as the style URL.

Leaflet

Radar Maps can be used as a base map for Leaflet through the maplibre-gl-leaflet library. It uses the same style URL format as in the MapLibre example above.

iOS

Radar Maps are compatible with MapLibre Native for iOS. For more info, see the displaying Radar Maps on iOS tutorial.

Android

Radar Maps are compatible with MapLibre Native for Android. For more info, see the displaying Radar Maps on Android tutorial.

React Native

Radar’s React Native SDK has built-in support for displaying Radar Maps. See the displaying Radar Maps with React Native tutorial for more info.

Flutter

Radar Maps can be used in a flutter application with flutter-maplibre-gl or flutter_map. See the displaying Radar Maps with Flutter tutorial for more info.

Google Maps

To use Radar Maps with your existing Google Maps implementation, see our Migration SDK for more details.

Coverage

Radar map data comes from OpenStreetMap. The following table describes data coverage for maps, by country, for consumer use cases (e.g., store locators) and logistics use cases (e.g., ride sharing, delivery).

Legend

Coverage

Support

Have questions? We’re here to help! Contact us at radar.com/support.