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

@geolonia/maps-react

v0.1.0

Published

React component wrapper for [Geolonia Maps](https://geolonia.com/). Provides declarative React components built on `@geolonia/maps-core`.

Readme

@geolonia/maps-react

React component wrapper for Geolonia Maps. Provides declarative React components built on @geolonia/maps-core.

Install

npm install @geolonia/maps-react maplibre-gl

Peer dependencies: react >= 18, react-dom >= 18, maplibre-gl >= 5

Usage

import 'maplibre-gl/dist/maplibre-gl.css';
import '@geolonia/maps-core/css';
import { Map, Marker, Source, Layer } from '@geolonia/maps-react';

function App() {
  return (
    <Map
      style="https://tile.openstreetmap.jp/styles/osm-bright/style.json"
      center={[139.7671, 35.6812]}
      zoom={14}
      containerStyle={{ width: '100%', height: '400px' }}
    >
      <Marker lat={35.6812} lng={139.7671} color="#E4402F">
        <p>Tokyo Station</p>
      </Marker>

      <Source id="stations" type="geojson" data={geojson}>
        <Layer
          id="stations-circle"
          type="circle"
          paint={{ 'circle-radius': 6, 'circle-color': '#007cbf' }}
        />
      </Source>
    </Map>
  );
}

Components

<Map>

Root component. Creates a Geolonia map instance and provides it to children via MapContext.

| Prop | Type | Description | |------|------|-------------| | apiKey | string | Geolonia API key | | style | string | Map style name or URL (e.g. "geolonia/basic-v2") | | center | [number, number] | Initial center [lng, lat] | | zoom | number | Initial zoom level | | bearing | number | Initial bearing (rotation) | | pitch | number | Initial pitch (tilt) | | hash | boolean | Sync map position with URL hash | | lang | 'ja' \| 'en' \| 'auto' | Language for style labels | | marker | boolean | Show default marker at center | | markerColor | string | Default marker color | | navigationControl | boolean \| ControlPosition | Navigation control | | geolocateControl | boolean \| ControlPosition | Geolocate button | | fullscreenControl | boolean \| ControlPosition | Fullscreen button | | scaleControl | boolean \| ControlPosition | Scale bar | | geoloniaControl | boolean \| ControlPosition | Geolonia logo | | minZoom / maxZoom | number | Zoom range | | gestureHandling | boolean | Gesture handling on scrollable pages | | loader | boolean | Loading animation | | 3d | boolean | Enable 3D mode | | className | string | CSS class for the container | | containerStyle | CSSProperties | Inline styles for the container | | onLoad | (map: GeoloniaMap) => void | Callback when map is loaded | | children | ReactNode | Child components | | ref | Ref<GeoloniaMap> | Ref to the map instance |

ControlPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'

<Marker>

Displays a marker at the given coordinates. Children are rendered as a popup.

<Marker lat={35.6812} lng={139.7671} color="red">
  <p>Popup content</p>
</Marker>

| Prop | Type | Description | |------|------|-------------| | lat | number | Latitude (required) | | lng | number | Longitude (required) | | color | string | Marker color (changing recreates the marker) | | openPopup | boolean | Show the popup on mount / toggle open state when changed | | children | ReactNode | Popup content |

<Popup>

Displays a standalone popup at the given coordinates.

<Popup lat={35.6812} lng={139.7671} onClose={() => console.log('closed')}>
  <p>Content</p>
</Popup>

| Prop | Type | Description | |------|------|-------------| | lat | number | Latitude (required) | | lng | number | Longitude (required) | | onClose | () => void | Callback when popup is closed | | children | ReactNode | Popup content |

<Source> / <Layer>

Declaratively add MapLibre sources and layers. Nesting <Layer> inside <Source> automatically inherits the source ID.

<Source id="my-source" type="geojson" data={geojson}>
  <Layer
    id="my-layer"
    type="circle"
    paint={{ 'circle-radius': 6, 'circle-color': '#007cbf' }}
  />
</Source>

<Layer> props match LayerSpecification from MapLibre GL, plus beforeId for insertion order.

useMap()

Hook to access the map instance from MapContext. Must be used inside <Map>.

import { useMap } from '@geolonia/maps-react';

function ZoomDisplay() {
  const map = useMap();
  return <div>Zoom: {map.getZoom().toFixed(1)}</div>;
}

useSourceId()

Hook to access the parent <Source> ID from SourceContext. Useful for custom layer components.

Development

npm install
npm run build     # ESM + CJS + DTS
npm run test      # Vitest unit tests
npm run test:coverage # Vitest with coverage report
npm run e2e       # Playwright E2E tests
npm run lint      # Biome
npm run dev       # Vite dev server (example/)

License

MIT