guanyang/open-agent-hub / skills/remotion-best-practices/remotion-markup
remotion-markup
VerifiedBest practices for writing Remotion React Markup
remotion-maps/techniques/maptiler/TECHNIQUE.md
View on GitHub# MapTiler maps in Remotion
MapTiler is a good solution for map animations where geographics features should be drawn as annotations on top of the map: Country borders, rivers, labels for POIs.
## MapTiler SDK (`@maptiler/sdk`)
Draw the basemap plus MapTiler Planet vector layers and custom GeoJSON into a WebGL canvas. Default styled-vector starting point: `MapStyle.BASIC`; satellite is an equally valid choice.
## Remotion
Imperatively update `setData`/`setPaintProperty`.
Use `jumpTo` only for a static shot, or a fixed map plate for any pan/zoom.
Gate with [`delayRender`](https://www.remotion.dev/docs/delay-render.md) until `map.once('idle')`.
Use `preserveDrawingBuffer:true`.
Render labels as positioned [`<Interactive.Div>`](https://www.remotion.dev/docs/interactive.md) elements.
Replace `YOUR_API_KEY` in `assets/MapTilerVectorElement.ts` with a MapTiler key.
Initialize the map once using a ref guard and update it imperatively per frame.
When constructing MapLibre/MapTiler layer objects, omit optional properties that are absent.
In particular, use `...(layer.filter ? {filter: layer.filter} : {})`; do not pass `filter: undefined`. An undefined filter can suppress the layer while separately created halo or border layers continue rendering, producing missing country fills and dark marker halos with no coloured cores.
Drive animation from `useCurrentFrame()` rather than CSS transitions or browser timers.
## Choose the source for each map element
Do not begin by manufacturing GeoJSON. First check whether MapTiler Planet already exposes the element as filtered vector data.
### MapTiler vector
Use it when the feature exists in a provider `source-layer`, its attributes support an exact filter, and provider geometry is editorially acceptable.
### Hybrid
Use it when ordinary geographic context can come from MapTiler while the claim depends on custom
evidence.
Animate each layer according to its source and meaning.
MapTiler vector features remain split across tiles. Do not use them for a semantic start-to-end line draw; extract, verify, order, and bake that element to GeoJSON first. Read **`references/map-data-sources.md`** and reuse **`assets/MapTilerVectorElement.ts`** for provider-layer setup and per-frame paint updates.
## Motion stability
**Do not call `map.jumpTo()` on every Remotion frame when the camera moves.** In headless capture it can make both MapTiler hillshade **and satellite imagery** shimmer/jitter, even when the source tiles load correctly. This is renderer resampling, not a data, network, or label problem.
For the implementation, read **`references/render-stability.md`** before building or debugging any moving map. It contains the fixed-map-plate recipe, diagnostics, and render checks.
- Use the live MapTiler camera only for a static shot.
- Keep pitch and bearing constant for a fixed plate. This technique does not implement a genuine changing 3D camera.
- Verify the moving preview and a short rendered MP4 before approving a beat. If any basemap detail wavers, switch to the fixed-plate pattern; do not try to solve it with tile retries or camera easing.
## Keep it minmal
Strip clutter on `load`: remove `symbol` layers (place labels) and `/other border/i` (admin-1 inner borders); hide the logo via CSS. Keep country + disputed borders.
## Files
Use as reference:
- `assets/MapTilerVectorElement.ts` — filtered MapTiler Planet elements.
- `references/map-data-sources.md` — provider vector versus custom GeoJSON selection.
- `references/render-stability.md` — camera motion and stable headless renders.
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 |