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-motion/core

v0.2.1

Published

Core library for Maplibre animated routes

Readme

@maplibre-motion/core

Maplibre plugin for applying animation.

Installation

npm install @maplibre-motion/core

Usage

addMotionRoute

Creates and animates a motion route on a MapLibre GL map. This function interpolates coordinates along a route path and animates the line drawing progressively.

Definition

addMotionRoute(options: MotionRouteOptions): void

Types

type Coordinate = {
  lat: number
  lng: number
}

type MotionRouteLayer = Omit<LayerSpecification, 'id' | 'source' | 'type'>

Parameters

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | id | string | ✅ | Unique identifier for the route source and layer | | map | Map | ✅ | MapLibre GL Map instance where the route will be displayed | | route | Coordinate[] | ✅ | Array of coordinate points defining the route path | | layer | MotionRouteLayer | ✅ | Layer configuration (excluding id, source, and type which are handled automatically) | | beforeId | string | ❌ | Optional ID of an existing layer to insert this route before | | distance | number | ❌ | Distance in kilometers between interpolated points for smoother animation (default: 0.05) |

Example

import { addMotionRoute } from 'maplibre-motion'
import maplibregl from 'maplibre-gl'

// Create a map instance
const map = new maplibregl.Map({
  container: 'map',
  style: 'https://demotiles.maplibre.org/style.json',
  center: [-74.0060, 40.7128],
  zoom: 10
})

// Define route coordinates
const route = [
  { lat: 40.7128, lng: -74.0060 }, // New York
  { lat: 40.7589, lng: -73.9851 }, // Times Square
  { lat: 40.7614, lng: -73.9776 }  // Central Park
]

// Add animated route
addMotionRoute({
  id: 'my-route',
  map: map,
  route: route,
  layer: {
    paint: {
      'line-color': '#ff0000',
      'line-width': 4,
      'line-opacity': 0.8
    }
  },
  distance: 0.01 // 10 meters between interpolated points
})

addMotionArc

Creates and animates an arc route on a MapLibre GL map. This function creates a curved path between two coordinates and animates the arc drawing progressively.

Definition

addMotionArc(options: MotionArcOptions): void

Types

type MotionArcLayer = Omit<LayerSpecification, 'id' | 'source' | 'type'>

Parameters

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | id | string | ✅ | Unique identifier for the arc source and layer | | map | Map | ✅ | MapLibre GL Map instance where the arc will be displayed | | startCoordinate | Coordinate | ✅ | Starting coordinate point for the arc | | endCoordinate | Coordinate | ✅ | Ending coordinate point for the arc | | layer | MotionArcLayer | ✅ | Layer configuration (excluding id, source, and type which are handled automatically) | | beforeId | string | ❌ | Optional ID of an existing layer to insert this arc before | | distance | number | ❌ | Distance in kilometers between interpolated points for smoother animation (default: 0.05) | | arcHeightPercentage | number | ❌ | Height of the arc as a percentage of the straight-line distance (default: 0.4) |

Example

import { addMotionArc } from 'maplibre-motion'
import maplibregl from 'maplibre-gl'

// Create a map instance
const map = new maplibregl.Map({
  container: 'map',
  style: 'https://demotiles.maplibre.org/style.json',
  center: [100.7482, 13.6817],
  zoom: 5
})

// Add animated arc
addMotionArc({
  id: 'flight-arc',
  map: map,
  startCoordinate: { lat: 13.6817, lng: 100.7482 }, // Bangkok
  endCoordinate: { lat: 35.0, lng: 133.0 }, // Japan
  layer: {
    paint: {
      'line-color': '#ff6b35',
      'line-width': 4,
      'line-opacity': 0.8
    }
  },
  arcHeightPercentage: 0.4 // 40% of straight-line distance height
})