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

@bertt/cesium-mapterhorn-provider

v0.1.0

Published

CesiumJS terrain provider for Mapterhorn (Terrarium-encoded WebP) tiles

Readme

cesium-mapterhorn-provider

A CesiumJS terrain provider for Mapterhorn tiles.

Mapterhorn serves global elevation as Terrarium-encoded 512 px WebP tiles in the XYZ / Web Mercator scheme:

height (m) = R * 256 + G + B / 256 - 32768

The provider downloads each tile, decodes the heights, resamples them to a (configurable) heightmap grid and hands them to Cesium.

Install

npm install @bertt/cesium-mapterhorn-provider cesium

Usage

ES module

import { Viewer, ImageryLayer, OpenStreetMapImageryProvider } from "cesium";
import { MapterhornTerrainProvider } from "@bertt/cesium-mapterhorn-provider";

const viewer = new Viewer("cesiumContainer", {
  baseLayer: new ImageryLayer(new OpenStreetMapImageryProvider({ url: "https://tile.openstreetmap.org/" })),
  terrainProvider: new MapterhornTerrainProvider({
    url: "https://tiles.mapterhorn.com/{z}/{x}/{y}.webp", // configurable
  }),
});

Script tag (global build)

<script src="https://cesium.com/downloads/cesiumjs/releases/1.146/Build/Cesium/Cesium.js"></script>
<script src="dist/cesium-mapterhorn-provider.min.js"></script>
<script>
  const viewer = new Cesium.Viewer("cesiumContainer", {
    terrainProvider: new CesiumMapterhorn.MapterhornTerrainProvider(),
  });
</script>

The global build requires window.Cesium to be loaded first.

Options

| Option | Default | Description | | --- | --- | --- | | url | https://tiles.mapterhorn.com/{z}/{x}/{y}.webp | URL template with {z}, {x}, {y} (point it at a self-hosted mirror if you like). | | maxLevel | 17 | Highest zoom level available. Deeper levels are upsampled by Cesium. | | heightmapResolution | 65 | Vertices per tile side (use 2^n + 1: 33, 65, 129). Higher = more detail, more CPU/memory. | | credit | "Mapterhorn" | Attribution shown in the viewer. | | headers | – | Extra HTTP request headers. | | ellipsoid | Ellipsoid.WGS84 | Ellipsoid. |

Build

Requires Node.js 18+.

npm install
npm run build

Output in dist/:

  • cesium-mapterhorn-provider.esm.js / .esm.min.js – ES module (imports cesium)
  • cesium-mapterhorn-provider.min.js – browser global CesiumMapterhorn (uses window.Cesium)

Run the demo

npm run build
npm start

Open http://localhost:8080/index.html – a 3D view of the Matterhorn using Mapterhorn terrain.

Publishing

See docs/PUBLISHING.md (npm registry, GitHub Packages, CDN).

Attribution & license

Terrain data © Mapterhorn and its source data providers – please follow their attribution and usage terms. Code: MIT.