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

@pasquelin/map3d-plugin-geopf

v0.1.1

Published

Plugin map3D — enrichit les bâtiments 3D au clic avec les attributs BDTOPO de la Géoplateforme IGN (WFS), via useBuildingEnrichment().

Readme

@pasquelin/map3d-plugin-geopf

Bâtiments France (BDTOPO) — enrichissement au pick. Au clic sur un bâtiment 3D, interroge le service WFS de la Géoplateforme IGN (BDTOPO_V3:batiment) et remonte ses attributs officiels (nature, usage, hauteur, étages, date de création, matériaux des murs…) via useBuildingEnrichment(). Le pick reste instantané : enrichBuilding s'exécute après buildingclick, en tâche de fond.

Voie « enrichir » du contrat plugin — zéro marker, zéro couche 3D : uniquement enrichBuilding.

Usage

import { Map } from '@pasquelin/map3d'
import { geopfBatiments } from '@pasquelin/map3d-plugin-geopf'

<Map plugins={[geopfBatiments()]} />

Le plugin est désactivé par défaut (enabledByDefault: false) : l'utilisateur l'active depuis le hub des plugins (menu Réglages). Une fois actif, il s'active sur l'outil « sélectionner un bâtiment » (pick de bâtiment 3D) déjà fourni par map3D.

Pour lire l'enrichissement dans l'hôte, monter un composant enfant de <Map> (le hook exige le contexte carte) :

import { useBuildingEnrichment } from '@pasquelin/map3d'

function BuildingInfo() {
  const e = useBuildingEnrichment()
  if (e.loading) return <div>Chargement…</div>
  if (e.error) return <div>Indisponible : {e.error.message}</div>
  if (!e.data) return null
  return <div>{Object.entries(e.data).map(([k, v]) => <div key={k}>{k} : {String(v)}</div>)}</div>
}

Configuration (geopfConfig)

| Clé | Type | Défaut | Refetch | Description | |---|---|---|---|---| | searchRadius | number (5–100) | 25 | oui | Rayon de recherche autour du point cliqué, en mètres — détermine la BBOX WFS envoyée. | | count | number (1–100) | 20 | oui | Nombre maximal de features demandées au service (COUNT). | | matchContaining | boolean | true | oui | Si vrai, retient le polygone qui contient le point cliqué ; sinon le plus proche par centroïde. | | showEmpty | boolean | false | non | Affiche aussi les attributs BDTOPO vides (sinon élagués). | | apiUrl | string | https://data.geopf.fr/wfs/ows | oui | Endpoint WFS (à changer pour un miroir/proxy éventuel). |

Détail technique

  • src/config.ts : schéma de config (PluginField[]) — seule source des défauts.
  • src/wfs.ts : buildGetFeatureUrl (BBOX carrée EPSG:4326 centrée sur le point) + pickBuilding (point-dans-polygone par ray casting, zéro dépendance).
  • src/attributes.ts : mapAttributes — projette les clés BDTOPO brutes sur des étiquettes FR stables (table FIELDS), élague les valeurs vides sauf showEmpty.
  • src/index.ts : geopfBatiments() — assemble le tout dans enrichBuilding.

Exemple

pnpm --filter @pasquelin/map3d-plugin-geopf-example dev

Nécessite VITE_CESIUM_ION_TOKEN (fichier .env du package example/) pour de vrais bâtiments 3D ; sans token l'exemple retombe sur le globe ellipsoïde de repli (le pick de bâtiment ne peut alors rien enrichir).