Remotion Rule: Maps
Remotion skill rule: Make map animations with Mapbox. Part of the official Remotion Agent Skill for programmatic video in React.
Staging seguro para este activo
Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.
npx -y tokrepo@latest install acc76203-2142-455f-aa36-a8d6b7a9fa1f --target codexPrimero deja archivos en staging; la activación requiere revisar el README y el plan staged.
What it is
Remotion Rule: Maps is a skill rule within the Remotion Agent Skill ecosystem. It provides instructions and patterns for creating animated map visualizations using Mapbox GL inside Remotion, the React-based programmatic video framework. The rule teaches AI coding agents how to render map flyovers, route animations, marker transitions, and geographic data visualizations as video frames.
This rule targets developers and AI agents building data-driven video content that includes geographic visualizations: travel videos, logistics dashboards, real estate tours, or news graphics with map context.
How it saves time or tokens
Without this skill rule, an AI agent would need to figure out the integration between Remotion's frame-based rendering model and Mapbox GL's JavaScript API from scratch. The rule encodes the correct patterns: how to interpolate camera positions across frames, how to render Mapbox tiles at specific zoom levels, and how to synchronize map animations with other video elements. This eliminates trial-and-error prompt cycles.
The rule also documents known pitfalls (tile loading timing, headless rendering constraints) that would otherwise consume debugging time and tokens.
How to use
- Install Remotion and the Mapbox GL package:
npm install remotion @remotion/player mapbox-gl. Get a Mapbox access token from mapbox.com. - Add the Remotion Maps rule to your AI agent's skill set (e.g., in Claude Code's
.claude/rules/or Cursor rules). - Prompt your AI agent to create a map animation. The rule guides the agent to use the correct Remotion + Mapbox integration patterns.
Example
import { useCurrentFrame, interpolate } from 'remotion';
import mapboxgl from 'mapbox-gl';
import { useEffect, useRef } from 'react';
export const MapFlyover: React.FC = () => {
const frame = useCurrentFrame();
const mapRef = useRef<mapboxgl.Map | null>(null);
const lat = interpolate(frame, [0, 150], [37.7749, 40.7128]);
const lng = interpolate(frame, [0, 150], [-122.4194, -74.0060]);
const zoom = interpolate(frame, [0, 75, 150], [12, 5, 12]);
useEffect(() => {
if (mapRef.current) {
mapRef.current.setCenter([lng, lat]);
mapRef.current.setZoom(zoom);
}
}, [frame]);
return <div id='map' style={{ width: 1920, height: 1080 }} />;
};
This component creates a camera flyover from San Francisco to New York, interpolating latitude, longitude, and zoom across 150 frames.
Related on TokRepo
- AI tools for video — Video generation and editing tools
- AI tools for design — Visual content creation tools
Common pitfalls
- Mapbox tiles load asynchronously. In Remotion's rendering pipeline, you must ensure tiles are fully loaded before capturing each frame. Use
delayRenderandcontinueRenderto handle async tile loading. - Mapbox GL requires a valid access token. Free tier includes limited map loads per month. High-frame-count videos can consume map loads quickly.
- Headless rendering (for video export) requires a WebGL context. Ensure your rendering environment supports GPU-accelerated WebGL or use software rendering fallbacks.
Preguntas frecuentes
Remotion is a React-based framework for creating videos programmatically. You write video scenes as React components, use hooks like useCurrentFrame for animation, and render to MP4 or WebM. It brings the React component model to video production.
Yes. Mapbox GL requires an access token for tile loading. Mapbox offers a free tier with a generous number of map loads per month. For video rendering with many frames, monitor your usage to stay within limits.
The rule is designed for Mapbox GL specifically. The patterns (camera interpolation, frame-based rendering) apply conceptually to other map libraries like Leaflet or Google Maps, but the API calls would differ.
Use Remotion's built-in rendering: npx remotion render src/index.tsx MapFlyover out/map-video.mp4. Remotion renders each frame as an image and encodes them into a video file using FFmpeg.
Yes. When loaded as a skill rule in Claude Code or Cursor, the AI agent receives the Mapbox + Remotion integration patterns as context. The agent can then generate map animation code that follows the correct patterns without trial and error.
Referencias (3)
- Remotion GitHub— Remotion is a React framework for programmatic video
- Mapbox GL Documentation— Mapbox GL JS for interactive maps
- Remotion Documentation— Remotion Agent Skills ecosystem
Relacionados en TokRepo
Fuente y agradecimientos
Created by Remotion. Licensed under MIT. remotion-dev/skills — Rule:
maps
Part of the Remotion AI Skill collection on TokRepo.
Discusión
Activos relacionados
Remotion Rule: Voiceover
Remotion skill rule: Adding AI-generated voiceover to Remotion compositions using TTS. Part of the official Remotion Agent Skill for programmatic video in React.
Remotion Rule: Text Animations
Remotion skill rule: Typography and text animation patterns for Remotion.. Part of the official Remotion Agent Skill for programmatic video in React.
Remotion Rule: Timing
Remotion skill rule: Interpolation curves in Remotion - linear, easing, spring animations. Part of the official Remotion Agent Skill for programmatic video in React.
Remotion Rule: Trimming
Remotion skill rule: Trimming patterns for Remotion - cut the beginning or end of animations. Part of the official Remotion Agent Skill for programmatic video in React.