.claude/skills/add-map-layer/SKILL.md
Add a data visualization layer to the Mapbox GL map page (heatmap, markers, clusters, isochrones). Use when building geospatial features like price heat maps or catchment analysis.
npx skillsauth add malhajri07/real-estate-CRM-project add-map-layerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Adds a new data layer to the existing map page. Supports heatmaps, clustered markers, polygon overlays, and isochrone areas.
Create the data API endpoint:
router.get("/analytics/geo/{layer-name}", authenticateToken, async (req, res) => {
const data = await prisma.properties.findMany({
where: { latitude: { not: null } },
select: { id: true, latitude: true, longitude: true, price: true, type: true },
});
// Return as GeoJSON FeatureCollection
res.json({
type: "FeatureCollection",
features: data.map(p => ({
type: "Feature",
geometry: { type: "Point", coordinates: [p.longitude, p.latitude] },
properties: { id: p.id, price: Number(p.price), type: p.type },
})),
});
});
Add the layer to the map component at apps/web/src/pages/map/index.tsx:
// After map loads:
map.addSource("price-heatmap", { type: "geojson", data: geojsonData });
map.addLayer({
id: "price-heatmap-layer",
type: "heatmap",
source: "price-heatmap",
paint: {
"heatmap-weight": ["interpolate", ["linear"], ["get", "price"], 0, 0, 5000000, 1],
"heatmap-intensity": 1,
"heatmap-radius": 30,
"heatmap-color": [
"interpolate", ["linear"], ["heatmap-density"],
0, "rgba(0,0,0,0)", 0.2, "#ffffb2", 0.4, "#fd8d3c", 0.6, "#f03b20", 0.8, "#bd0026",
],
},
});
Add layer toggle in the map toolbar:
<Button variant={showHeatmap ? "default" : "outline"} onClick={() => toggleLayer("price-heatmap")}>
خريطة الأسعار
</Button>
Add click interaction — click on area → tooltip with aggregated stats.
Use react-query to fetch GeoJSON data with /add-react-query.
/typecheck passestesting
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
tools
Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
data-ai
Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
tools
Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.