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

maplibre-gl-three

v0.0.4

Published

Brings Three.js capabilities into MapLibre GL JS.

Readme

This library brings Three.JS capabilities into Maplibre-gl-js. Currently focused on enabling 3DTiles in MapLibre. It internally relies on 3d-tiles-renderer.

This project is not officially affiliated with MapLibre

Project status

Repo is still under construction. The project is in its infancy.

As of now, no pull requests are accepted. The situation will likely change once the repository structure is stable.

Installation and basic usage

NPM install:

npm install three 3d-tiles-renderer maplibre-gl maplibre-gl-three 

Load 3dTiles:

import {ThreeDManager} from 'maplibre-gl-three';
import maplibregl from 'maplibre-gl';

const threeDManager = new ThreeDManager();
const agiHqTiles = threeDManager.load3dTiles({
    tilesetUrl: 'https://pelican-public.s3.amazonaws.com/3dtiles/agi-hq/tileset.json',
    layerId: 'agiHqTiles',
    offset: { east: 0, up: -300, south: 0 },
});
const map = new maplibregl.Map(
    container: 'YOUR-HTML-MAPLIBRE-CONTAINER',
    zoom: 16,
    center: [-75.596, 40.038],
    pitch: 55,
    bearing: -20,
    maxPitch: 85,
    style: 'YOUR-MAPLIBRE_STYLE'
);
map.addLayer(agiHqTiles.getLayer());

The repository contains a minimal NPM-based example project running the code above.

Swapping to new tiles:

tiles.destroy(); // will implicitly call map.removeLayer('agiHqTiles'); if needed
const tiles2 = threeDManager.load3dTiles({tilesetUrl: 'https://pelican-public.s3.amazonaws.com/3dtiles/agi-hq/tileset.json'});
map.addLayer(tiles2.getLayer());

Teardown:

threeDManager.destroy(); // will implicitly call destroy() on all assets not yet destroyed.

ThreeDManager optional constructor options:

  • debugMode: If true, will render the 3JS anchor point for debugging purposes.
  • dracoPath: The path to the Draco loader to be lazy loaded. Defaults to https://unpkg.com/[email protected]/examples/jsm/libs/draco/.
  • ktx2Path: The path to the ktx2 loader. Defaults to https://unpkg.com/[email protected]/examples/jsm/libs/basis/.
  • Additionally, handleAnchorPoint(mapInstance) and getTransformParameters(anchor4326) are advanced callbacks for overriding the calculation of the anchor point and the internal transform parameters, respectively. In the future the usage of these callbacks may be better documented. In the meantime see www/examples/other/plate-caree/ for a usage example of the plate-caree projection.

load3dTiles optional options:

  • offset: Optional { east, up, south } translation applied to the 3d tiles in meters.

CDNs and direct browser import

You don't have to use a package manager. The repository contains an example for a direct dependency import from a CDN. If you prefer to host all the dependencies yourself, there's also a self-hosting example. There's a convenience script to run these examples. See the next section.

Run the examples and demos

You can locally the examples by running node-static-server.sh then browsing to http://localhost:6153. These include:

  • Non-npm Bundling options
    • CDN
    • Self-hosting
  • Interesting use cases
    • TODO heightmap
  • Exotic use cases
    • Use Maplibre+ThreeJS with "unprojected" / Plate Carree background tiles www/examples/other/plate-caree/. Some more documentation may be provided in the future.

Development

To keep it simple there is currently no compilation/packing/minifcation step. The source code which is at src/library is what is ultimately published. This will possibly change in the future to properly support TypeScript.

You can develop locally by pointing maplibreGlThree-npm-example to the local files rather than npm. In package.json put this line in the dependencies: "maplibre-gl-three": "file:../../..". Alternatively, you can run node-static-server.sh which serves the non-npm examples. Modify the source code and refresh the page. No build step.

Known issues / Notes

  • Tiles go wild if camera moves away far enough.
  • Does not yet work with the globe projection.

TODOS

See TODOS.md.