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 🙏

© 2025 – Pkg Stats / Ryan Hefner

mapboxgljs-ellipsis

v3.1.7

Published

Use Ellipsis Drive layers in mapboxgl.js projects.

Readme

Import the Ellipsis library in a mapbox-gl-js project

with script tags

<!-- Import Mapbox -->
<link
  href="https://api.mapbox.com/mapbox-gl-js/v2.5.1/mapbox-gl.css"
  rel="stylesheet"
/>
<script src="https://api.mapbox.com/mapbox-gl-js/v2.5.1/mapbox-gl.js"></script>
<!-- Import the latest version of the ellipsis library -->
<script src="https://github.com/ellipsis-drive/ellipsis-js-util/releases/download/1.3.3/ellipsis-js-util-1.3.3.js"></script>
<script src="https://github.com/ellipsis-drive/mapboxgljs-package/releases/download/3.1.2/mapboxgljs-ellipsis-3.1.2.js"></script>

with npm npm install mapboxgljs-ellipsis

Add an Ellipsis Drive layer to a mapbox map

Example

import {
	EllipsisVectorLayer,
	EllipsisRasterLayer,
	AsyncEllipsisRasterLayer,
} from 'mapboxgljs-ellipsis';


const map = L.map("map", {
  center: [51.505, -0.09],
  zoom: 13,
});

// Raster layer
new EllipsisRasterLayer({
  pathId,
  timestampId,
  style:styleId,
  token: yourToken,
}).addTo(map);

// Vector layer
new EllipsisVectorLayer({
  pathId,
  token: yourToken,
}).addTo(map);

The timestampId and style are required for raster layers, you can use AsyncEllipsisRasterLayer in order to make use of defaults suggested by the server.


const createEllipsisRasterLayer = async () => {
  const someRaster = await MapboxgljsEllipsis.AsyncEllipsisRasterLayer({
    pathId: "28fb0f5f-e367-4265-b84b-1b8f1a8a6409",
  });
  someRaster.addTo(map);
};

createEllipsisRasterLayer();

Obtaining tokens

To use layers that are not set to public or link sharing you need to pass a token as a parameter. See here for how to obtain such a token.

RasterLayer options

| Name | Description | | ----------- | ------------------------------------------ | | pathId | id of the path | | timestampId | id of the timestamp | | style | id of the style or an object describing it | | token | token of the user |

note for the style object, refer to this documentation about it.

VectorLayer options

| Name | Description | | ------------------ | ------------------------------------------------------------------------ | | pathId | Id of the path | | timestampId | Id of the timestamp | | style | id of the style or an object describing it | | onFeatureClick | A function to run on feature click, with as argument the clicked feature | | onFeatureHover | A function to run on when the cursor hovers over a feature. With arguments the feature and the event | | token | Token of the user | | id | a prefix to use in all sources and layers that are added to the map | | filter | A property filter to use |

onFeatureClick gets passed two parameters: the geojson of the clicked feature and the event.

note for the style object, refer to this documentation about it.

VectorLayer styling

A vectorlayer can add multiple style layers to your mapbox map. To view all added styling, call yourVectorLayer.getLayers(). You can also get and use the source that contains geojson with yourVectorLayer.getSource().

Use the EllipsisApi to view metadata of layers

EllipsisApi.getInfo description

parameters | name | description | | -- | -- | | pathId | The id of the folder or layer. | | user | (Optional) An user object which can contain a token like user: {token: mytoken} |

return value It returns JSON, which depends on the type of the specified object.