guanyang/open-agent-hub / skills/remotion-best-practices/remotion-markup
remotion-markup
VerifiedBest practices for writing Remotion React Markup
remotion-maps/techniques/maptiler/assets/MapTilerVectorElement.ts
View on GitHub// Surface an existing MapTiler Planet feature without maintaining duplicate GeoJSON.
// Paint animation is deterministic; geometry slicing is not. For a source-to-end line draw,
// bake the selected feature to ordered GeoJSON first.
type VectorLayerType = 'fill' | 'line' | 'circle' | 'symbol';
export type MapTilerVectorElement = {
id: string;
sourceLayer: string;
type: VectorLayerType;
filter?: unknown[];
minzoom?: number;
maxzoom?: number;
layout?: Record<string, unknown>;
paint: Record<string, unknown>;
};
const SOURCE_ID = 'maptiler-planet';
export const addMapTilerVectorElement = (
map: any,
element: MapTilerVectorElement,
beforeId?: string,
) => {
if (!map.getSource(SOURCE_ID)) {
map.addSource(SOURCE_ID, {
type: 'vector',
url: 'https://api.maptiler.com/tiles/v3/tiles.json?key=YOUR_API_KEY',
});
}
if (map.getLayer(element.id)) return;
map.addLayer(
{
id: element.id,
type: element.type,
source: SOURCE_ID,
'source-layer': element.sourceLayer,
...(element.filter ? {filter: element.filter} : {}),
...(element.minzoom === undefined ? {} : {minzoom: element.minzoom}),
...(element.maxzoom === undefined ? {} : {maxzoom: element.maxzoom}),
...(element.layout ? {layout: element.layout} : {}),
paint: element.paint,
},
beforeId,
);
};
export const setVectorElementPaint = (
map: any,
layerId: string,
paint: Record<string, unknown>,
) => {
for (const [property, value] of Object.entries(paint)) {
map.setPaintProperty(layerId, property, value);
}
};
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |