npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@radarlabs/plugin-maps

v1.1.0

Published

Maps plugin for radar-sdk-js

Downloads

2,400

Readme

🚀 Installation and Usage

With npm

# with npm
npm install @radarlabs/plugin-maps radar-sdk-js maplibre-gl

# with yarn
yarn add @radarlabs/plugin-maps radar-sdk-js maplibre-gl

Then import and initialize:

import Radar from 'radar-sdk-js';
import { createMapsPlugin } from '@radarlabs/plugin-maps';
import '@radarlabs/plugin-maps/dist/radar-maps.css';

Radar.registerPlugin(createMapsPlugin());
Radar.initialize({ publishableKey: 'prj_test_pk_...' });

With a script tag

Include after the core SDK:

<link href="https://js.radar.com/maps/v1.0.0/radar-maps.css" rel="stylesheet" />
<script src="https://js.radar.com/v5.0.0/radar.min.js"></script>
<script src="https://js.radar.com/maps/v1.0.0/radar-maps.min.js"></script>

The CDN bundle auto-registers with the core SDK when loaded.

Quickstart

Create a map

Radar.ui.map() returns a RadarMap instance, which extends maplibregl.Map.

const map = Radar.ui.map({
  container: 'map',
  style: 'radar-default-v1', // radar-default-v1 | radar-light-v1 | radar-dark-v1
  center: [-73.991, 40.735],
  zoom: 14,
});

Built-in Radar styles (radar-default-v1, radar-light-v1, radar-dark-v1) are resolved automatically. You can also pass a custom style id.

Add markers

Radar.ui.marker() returns a RadarMarker instance, which extends maplibregl.Marker.

const marker = Radar.ui
  .marker({
    color: '#000257',
    popup: {
      text: 'Radar HQ',
    },
  })
  .setLngLat([-73.991, 40.735])
  .addTo(map);

Create a popup

Radar.ui.popup() returns a maplibregl.Popup instance:

const popup = Radar.ui
  .popup({
    text: 'Hello world',
  })
  .setLngLat([-73.991, 40.735])
  .addTo(map);

API

Map options

RadarMapOptions extends maplibregl.MapOptions with these additions:

| Option | Type | Default | Description | | ------------------ | --------- | ------- | ---------------------------- | | language | string | — | Language code for map labels | | showZoomControls | boolean | true | Show zoom in/out buttons |

Marker options

| Option | Type | Default | Description | | -------- | ------------------- | ----------- | ------------------------------ | | color | string | '#000257' | Marker fill color | | marker | string | — | Radar-hosted marker image name | | url | string | — | Custom marker image URL | | width | number \| string | — | Marker image width | | height | number \| string | — | Marker image height | | popup | RadarPopupOptions | — | Popup to display on click |

All standard maplibregl.MarkerOptions are also supported (for example, element, scale, draggable).

Map helpers

RadarMap provides helpers for working with markers and GeoJSON features:

// markers
map.getMarkers();
map.fitToMarkers();
map.clearMarkers();

// GeoJSON features
map.addPolygon(geojsonFeature, { paint: { 'fill-color': '#000257', 'fill-opacity': 0.3 } });
map.addLine(lineFeature, { paint: { 'line-color': '#000257', 'line-width': 2 } });
map.addPolyline(encodedPolyline, { precision: 6 });
map.fitToFeatures();
map.clearFeatures();

Access MapLibre GL JS directly

The underlying MapLibre GL JS module is available at Radar.ui.maplibregl:

const bounds = new Radar.ui.maplibregl.LngLatBounds(sw, ne);

Peer dependencies

| Package | Version | | -------------- | -------------------------------------------- | | radar-sdk-js | ^5.0.0 | | maplibre-gl | ^2.4.0 \|\| ^3.0.0 \|\| ^4.0.0 \|\| ^5.0.1 |

📫 Support

Have questions? We're here to help! Email us at [email protected].