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

zmapgl

v0.1.4

Published

MUI-native, theme-aware map components built on MapLibre GL — markers, popups, controls, routes, arcs, clusters, and pluggable providers.

Downloads

579

Readme

zmap

MUI-native map components built on MapLibre GL.

zmap gives Material UI apps a set of composable, theme-aware map components — the map equivalent of the MUI components you already use. Markers, popups, tooltips, controls, routes, arcs and clustering, all rendered through MUI and wired into your theme (including automatic light/dark basemaps).

Install

npm install zmapgl @mui/material @mui/icons-material \
  @emotion/react @emotion/styled maplibre-gl

react, react-dom, MUI and Emotion are peer dependencies. The MapLibre stylesheet is imported by the package automatically — no extra CSS import is required with Vite, Next.js, or any bundler that handles library CSS imports.

Quick start

Components are declared as a typed FC arrow, default-exported:

import type { FC } from "react";
import { Map, MapControls, Marker, Popup } from "zmapgl";

const MyMap: FC = () => {
  return (
    <Map center={[-0.1276, 51.5072]} zoom={11} sx={{ height: 420 }}>
      <MapControls position="top-right" />
      <Marker longitude={-0.1276} latitude={51.5072} />
    </Map>
  );
};

export default MyMap;

Wrap your app in an MUI ThemeProvider as usual — zmap reads the theme for colors and to switch the basemap between light and dark.

Components

| Component | Purpose | | --------------- | -------------------------------------------------------------- | | Map | Container; creates the MapLibre instance and provides context. | | Marker | Render any MUI content at a coordinate (portal-based). | | Popup | Theme-aware popup anchored to a coordinate. | | Tooltip | Lightweight, non-interactive label (a Popup variant). | | MapControls | MUI zoom / compass / geolocate / fullscreen / scale cluster. | | Route | Draw a polyline from coordinates. | | Arc | Draw a curved (bezier or great-circle) line between two points.| | Cluster | Native MapLibre clustering rendered as themed MUI markers. | | LayerControl | Collapsible MUI panel that toggles registered layers on/off. | | Layer | Register a toggleable overlay; pairs with LayerControl. | | PointLayer | Render many points as a single GPU circle layer. | | HeatmapLayer | Render points as a density heatmap. | | ShapeLayer | GeoJSON polygons / lines, with optional choropleth fill. | | GeoJSONLayer | Low-level escape hatch for custom sources + layers. |

Hooks: useMap() (the raw MapLibre instance), useMapLayer(), useColorScheme().

Providers & theming

Switch basemaps with the provider prop:

<Map provider="carto" />   {/* default — positron / dark-matter, theme-aware */}
<Map provider="osm" />     {/* OpenStreetMap raster */}

{/* Anything MapLibre-compatible: */}
<Map provider="https://tiles.example.com/style.json" />
<Map provider={myStyleSpecification} />

Bring your own provider by implementing MapProvider:

import type { MapProvider } from "zmapgl";

export const maptiler: MapProvider = {
  id: "maptiler",
  getStyle: (mode) =>
    `https://api.maptiler.com/maps/${mode === "dark" ? "dataviz-dark" : "dataviz"}/style.json?key=YOUR_KEY`,
  attribution: "© MapTiler © OpenStreetMap contributors",
};

colorScheme controls light/dark: "auto" (default, follows the MUI theme), "light", or "dark".

Dropping down to MapLibre

zmap stays close to MapLibre. Grab the instance whenever you need the raw API:

import { useEffect, type FC } from "react";
import { useMap } from "zmapgl";

const FitBounds: FC = () => {
  const map = useMap();
  useEffect(() => {
    map?.fitBounds([[-10, 35], [40, 60]]);
  }, [map]);
  return null;
};

export default FitBounds;

License

MIT. CARTO's default basemaps require an Enterprise plan for commercial use — switch providers before shipping to production.