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

@viamrobotics/prime-map

v0.2.2

Published

MapLibre maps for Svelte 5: the map, markers, map controls, and an optional Three.js bridge.

Readme

@viamrobotics/prime-map

MapLibre maps for Svelte 5: a map that fills its parent, markers, map controls, projection math between longitude and latitude and meters, and an optional bridge that renders a Three.js scene on the map.

[!NOTE] Under active development. The public API is unstable until 1.0.

Installation

pnpm add @viamrobotics/prime-map @viamrobotics/prime-ui @viamrobotics/prime-controls @viamrobotics/tailwind-config maplibre-gl

Requires svelte ^5.29.0 and maplibre-gl ^6.0.0. Add three >=0.178.0 only to use the @viamrobotics/prime-map/three subpath. Import the stylesheets once, after Tailwind:

@import 'tailwindcss';
@import '@viamrobotics/prime-ui/styles.css';
@import '@viamrobotics/prime-controls/styles.css';
@import '@viamrobotics/prime-map/styles.css';

MapLibre imports maplibre-gl's own stylesheet.

Usage

<script lang="ts">
	import {
		MapLibre,
		MapLibreMarker,
		NavigationControls,
		SatelliteControls
	} from '@viamrobotics/prime-map';
	import { LngLat } from 'maplibre-gl';
</script>

<div class="h-96">
	<MapLibre center={new LngLat(-73.98, 40.77)} zoom={14}>
		<MapLibreMarker lng={-73.98} lat={40.77} />
		<NavigationControls />
		<div class="absolute bottom-2 left-2">
			<SatelliteControls />
		</div>
	</MapLibre>
</div>

MapLibre fills its parent, so size the parent. bind:center, bind:zoom, and bind:satellite follow the camera and the satellite view, and bind:map gives the maplibre-gl Map. Its children mount once the map loads its first style and read the map through useMapLibre(), whose fields are reactive: map, center, zoom, maxZoom, size, mapProvider, apiKey, and a writable satellite. useMapLibreEvent(event, listener) listens to a map event until the calling component unmounts. Set mapProvider="google-maps" and mapProviderKey for Google Maps tiles, which fall back to OpenStreetMap when the key cannot open a session.

CenterControls, FollowControls, NavigationControls, and SatelliteControls go inside a MapLibre. CenterControls saves the view in localStorage under its storageKey, when one is given. LngLatInput is a latitude and longitude pair of fields that works anywhere.

Three.js

<script lang="ts">
	import { useMapLibreThreeRenderer } from '@viamrobotics/prime-map/three';
	import { Camera, Mesh, Scene, WebGLRenderer } from 'three';

	const { renderer }: { renderer: WebGLRenderer } = $props();

	const scene = new Scene();
	const camera = { current: new Camera() };
	const mesh = new Mesh();
	mesh.userData.lngLat = { lng: -73.98, lat: 40.77 };
	scene.add(mesh);

	useMapLibreThreeRenderer(scene, camera, (scene, camera) => renderer.render(scene, camera));
</script>

Call the hooks in a component inside a MapLibre. useMapLibreThreeRenderer places every object whose userData.lngLat holds a { lng, lat }, and draws a THREE.Line through a list of them. useMapLibreThreeRaycast(camera) returns a pointer that follows the mouse and a compute(raycaster) that aims a raycaster through it. Nothing on the . entry imports three.

Documentation

See the package docs for the context, the controls, and the Three.js bridge.

Development

This package lives inside the viamrobotics/prime monorepo. See the package CLAUDE.md for stack, layout, and commands.

License

Apache-2.0