portaljs-add-map
Skill2.4k starsChanged 12 days agoMITView on GitHub
Render a GeoJSON dataset on an interactive Leaflet map in the Views section of a dataset's showcase. Installs react-leaflet and a Map component, then renders the map for the chosen dataset. Use when a dataset's data is geographic and a map view is needed alongside the showcase's default metadata and download.
- Installs packages
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Add an interactive Leaflet map as a view on a dataset's showcase in a portaljs-catalog portal.
- Very specific: line 52
Write components/MapView.tsx and components/Map.tsx (idempotent — skip if Map.tsx already exists).
- Very specific: line 57
Verify with npx tsc --noEmit (never next build against a live dev server).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PortalJS — Add Map
Overview
Add an interactive Leaflet map as a view on a dataset's showcase in a
portaljs-catalog portal. The skill installs react-leaflet/leaflet (added directly —
never @portaljs/components), writes a reusable Map component split across
MapView.tsx (the Leaflet code) and Map.tsx (a dynamic(..., { ssr: false }) wrapper,
since Leaflet touches window at module load), and renders <Map /> into the Views
section of the showcase route pages/[owner]/[slug].tsx for one chosen GeoJSON dataset.
The dataset should already carry format: "geojson" in datasets.json; if it doesn't
exist yet, the skill can copy the file and register it first.
Prerequisites
- A scaffolded PortalJS portal (see
portaljs-new-portal). - The target dataset registered in
datasets.jsonwithformat: "geojson"(seeportaljs-add-dataset), or a GeoJSON source file/URL to register. - Node 18+ and npm available in the portal directory.
Instructions
The canonical, full step-by-step workflow is
.claude/commands/portaljs-add-map.md — the
single source of truth. Read and follow it when executing. Summary:
- Gather input — dataset slug (or a GeoJSON source to register), portal directory. If any is missing, interview the user; never dead-end on a missing value.
- Validate the portal directory (
datasets.json,package.json,pages/[owner]/[slug].tsxmust exist). - Resolve the dataset from
datasets.json, or validate and register a new GeoJSON source (copy to/public/data/, append a manifest entry). - Install map dependencies:
npm install react-leaflet@^5 leaflet@^1.9andnpm install -D @types/leaflet(skip if already present). - Write
components/MapView.tsxandcomponents/Map.tsx(idempotent — skip ifMap.tsxalready exists). - Render
<Map />into the Views section, gated on the dataset's(namespace, slug)so other showcases are unaffected. Extend an existing view-dispatch block, do not overwrite it. - Verify with
npx tsc --noEmit(nevernext buildagainst a live dev server). - Report the component, route, and dependency added.
Output
- Created:
components/MapView.tsxandcomponents/Map.tsx(Leaflet wrapper, if absent);public/data/<slug>.geojson(only when registering a new dataset). - Modified:
pages/[owner]/[slug].tsx(import + gated<Map />in Views);datasets.json(only when registering a new dataset);package.json(react-leaflet,leaflet,@types/leaflet). - UI strings: any text it adds to JSX renders through
t()(lib/i18n.ts), with the keys added tolocales/en.jsonand every otherlocales/*.json;npm run i18n:checkpasses. - Verified:
npx tsc --noEmitpasses. - Result: the map renders at
/@<namespace>/<slug>under a "Views" heading.
Error Handling
| Symptom | Cause | Fix |
| Dataset not found or not GeoJSON | Slug missing from datasets.json or format is tabular | List GeoJSON datasets and re-prompt; suggest portaljs-add-chart for tabular data. |
| Source fetch/copy fails | URL returns non-200 or local path missing | Report the HTTP status or missing path; ask for a corrected source. |
| "Not valid GeoJSON" | Parsed JSON type isn't a Feature/geometry type | Tell the user and point to portaljs-add-dataset for tabular data. |
tsc failure | Bad import path or gating condition | Fix the first reported error before reporting success. |
| Map appears on every dataset | View not gated on (namespace, slug) | Wrap the <Map /> render in the dataset check shown in the Instructions. |
| Features render in the wrong place | Data isn't WGS84 (EPSG:4326) lon/lat | Reproject the source data to WGS84 before adding. |
| Slow render | Thousands of features in one file (>5MB) | Simplify geometries (e.g. mapshaper) before adding. |
Examples
Example 1 — Map an already-registered dataset
/portaljs-add-map dataset=park-boundariesExample 2 — Register a local GeoJSON file and map it
/portaljs-add-map source=./data/bike-routes.geojson slug=bike-routes name="Bike Routes"Example 3 — Register a remote GeoJSON URL and map it
/portaljs-add-map source=https://example.com/districts.geojson slug=districts namespace=referenceResources
- Full workflow:
.claude/commands/portaljs-add-map.md - Map props and troubleshooting reference:
references/reference.md - Related skills:
portaljs-add-dataset,portaljs-add-chart,portaljs-define-schema - react-leaflet documentation: https://react-leaflet.js.org/
Trending
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about datopian/portaljs
- A Hacker News story“Show HN: PortalJS – AI-native, open-source framework for data portals”Hacker News · Jul 15, 2026 · 10 points
- fuma-nama/fumadocs“[feat] support obsidian style wikilinks, backlinks, embeds, graph view”GitHub · Mar 17, 2025 · 1 reactions
- sudosubin/agents.nix“claude-code-marketplaces.github.datopian.portaljs: init at 0-unstable-2026-10-27”GitHub · Oct 28, 2026
- sudosubin/agents.nix“agent-skills.github.datopian.portaljs: 0-unstable-2026-10-15 → 0-unstable-2026-10-20”GitHub · Oct 20, 2026
- sudosubin/agents.nix“agent-skills.github.datopian.portaljs: 0-unstable-2026-08-20 → 0-unstable-2026-10-15”GitHub · Oct 20, 2026
The biggest 5 of 38 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 38
Talked about on GitHub and Hacker News (38 times).
On GitHub · 37
- Mar 17, 2025[feat] support obsidian style wikilinks, backlinks, embeds, graph view — fuma-nama/fumadocs1 reaction · 1 comment
- Oct 28, 2026claude-code-marketplaces.github.datopian.portaljs: init at 0-unstable-2026-10-27 — sudosubin/agents.nix0 reactions
- Oct 20, 2026agent-skills.github.datopian.portaljs: 0-unstable-2026-10-15 → 0-unstable-2026-10-20 — sudosubin/agents.nix0 reactions
- Oct 20, 2026agent-skills.github.datopian.portaljs: 0-unstable-2026-08-20 → 0-unstable-2026-10-15 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.datopian.portaljs: 1.4.0-unstable-2026-08-20 → 0-unstable-2026-08-20 — sudosubin/agents.nix0 reactions
32 more on GitHub
- Sep 30, 2026docs: fix typos and a stale CKAN example link — olitreadwell/portaljs0 reactions
- Sep 26, 2026agent-skills.github.datopian.portaljs: init at 1.4.0-unstable-2026-08-20 — sudosubin/agents.nix0 reactions
- Sep 26, 2026[Candidate] datopian/portaljs/skills/portaljs-add-dataset - portaljs-add-dataset — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] datopian/portaljs/skills/portaljs-add-chart - portaljs-add-chart — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] datopian/portaljs/skills/arcgis-to-portaljs - arcgis-to-portaljs — ProSkillsMD/proskills0 reactions · 1 comment
- Aug 12, 2026fix(ckan): make Pagination page buttons readable by screen readers — olitreadwell/portaljs0 reactions
- Aug 12, 2026fix(ckan-api-client-js): restore validation error fallback message — olitreadwell/portaljs0 reactions
- Aug 12, 2026fix(create-portaljs): make the scaffold template source repo-aware — olitreadwell/portaljs0 reactions
- Jul 8, 2026Add charts to the homepage — datopian/portaljs-research0 reactions · 2 comments
- Jul 7, 2026Add PortalJS plugin (datopian/portaljs) — tmcpa/claudedirectory0 reactions · 1 comment
- Jun 25, 2026Improve ui/ux — datopian/portaljs-research0 reactions · 2 comments
- Mar 24, 2026content: migrate two legacy Flowershow tutorials from portaljs.com — flowershow/flowershow0 reactions · 2 comments
- Dec 12, 2025Consolidate datahubio repos into datasets org — datasets/collective0 reactions
- Nov 21, 2025Added scope organization param into MCP URL to allow specific organizations — datopian/portaljs-mcp-server0 reactions · 2 comments
- Oct 29, 2025[BUG Fix] Pagination and table — datopian/portaljs-frontend-starter0 reactions · 2 comments
- Oct 19, 2025[BUG FIX] Frontend table preview — datopian/portaljs-frontend-starter0 reactions · 2 comments
- Oct 19, 2025[Bug Fix] Table Preview Frontend issues — datopian/portal-lcc0 reactions · 2 comments
- Oct 9, 2025preview data table tool — datopian/portaljs-mcp-server0 reactions · 1 comment
- Oct 7, 2025[IMPLEMENTING] Auth for portalJS key — datopian/portaljs-mcp-server0 reactions · 2 comments
- Sep 18, 2025Dataverse Harvester Implementation — datopian/harvesterjs0 reactions · 1 comment
- Jul 6, 2025Move all flowershow stuff from portaljs and add redirects — flowershow/flowershow0 reactions · 1 comment
- May 9, 2025Enable Iframe previews — datopian/portaljs-frontend-starter0 reactions · 2 comments
- Dec 28, 2023Transfer here "create a simple catalog of anything using markdown" — flowershow/wayofmarkdown0 reactions · 8 comments
- Dec 14, 2023Migrate content from portaljs.org/guide to this site — flowershow/wayofmarkdown0 reactions · 6 comments
- Oct 23, 2023[DO-NOT_MERGE] Improvement suggestions — flowershow/flowershow0 reactions · 1 comment
- Sep 20, 2023When I have a remote content e.g. https://github.com/datasets/awesome-data I want to load and render that (statically) so that i can author content in another repo but render it here — Valecia2023/caring.net0 reactions
- Jun 12, 2023Setup auto-publishing to npm — flowershow/markdowndb0 reactions
- May 26, 2023Turn this repo into core template and move core lib to portaljs repo — flowershow/flowershow0 reactions · 2 comments
- May 17, 202317 consolidate gitignore and expand its entries — hackforla/accessthedata-ckan0 reactions
- May 16, 2023[EPIC] Editor guide: how to contribute content and datasets — flowershow/wayofmarkdown0 reactions · 2 comments
- Apr 28, 2023[epic] MarkdownDB site (landing page) and "launch" — flowershow/markdowndb0 reactions · 6 comments
- Oct 30, 2022Analytics other than Google Analytics (and switch to pliny model) — flowershow/flowershow0 reactions · 2 comments
On Hacker News · 1
- Jul 15, 2026Show HN: PortalJS – AI-native, open-source framework for data portals10 points · 1 comment
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- site/CLAUDE.mdCLAUDE.md
- arcgis-to-portaljsSkill
- portaljs-add-chartSkill
- portaljs-add-datasetSkill
- portaljs-add-dcatSkill
- portaljs-add-geoSkill
- portaljs-add-resourceSkill
- portaljs-architectSkill
- portaljs-check-data-qualitySkill
- portaljs-connect-ckanSkill
- portaljs-define-schemaSkill
- portaljs-deploySkill
- portaljs-migrateSkill
- portaljs-new-portalSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

