
react-google-maps
Expert implementation of @vis.gl/react-google-maps library for Google Maps in React. Use when building maps, markers, pins, infowindows, places autocomplete, geocoding, draggable markers, polygons, circles, polylines, drawing tools, or any Google Maps JavaScript API integration in React/Next.js applications.
- Installs
- 41
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/horuz-ai/claude-plugins --skill react-google-maps- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads react-google-maps automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
@vis.gl/react-google-maps
Official React library for Google Maps JavaScript API, maintained by vis.gl with Google sponsorship.
Quick Start
import { APIProvider, Map, AdvancedMarker, Pin } from '@vis.gl/react-google-maps';
function App() {
return (
<APIProvider apiKey={process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY!}>
<Map
style={{ width: '100%', height: '400px' }}
defaultCenter={{ lat: 18.4655, lng: -66.1057 }}
defaultZoom={12}
mapId="YOUR_MAP_ID" // Required for AdvancedMarker
>
<AdvancedMarker position={{ lat: 18.4655, lng: -66.1057 }}>
<Pin background="#0f9d58" borderColor="#006425" glyphColor="#60d98f" />
</AdvancedMarker>
</Map>
</APIProvider>
);
}
Installation
npm install @vis.gl/react-google-maps
Key Exports
// Components
import {
APIProvider, // Wraps app, loads Maps JS API
Map, // Map container
AdvancedMarker, // Modern marker (requires mapId)
Pin, // Customizable pin for AdvancedMarker
InfoWindow, // Popup windows
MapControl, // Custom controls on map
Marker, // Legacy marker (deprecated)
} from '@vis.gl/react-google-maps';
// Hooks
import {
useMap, // Access google.maps.Map instance
useMapsLibrary, // Load additional libraries (places, geocoding, drawing)
useAdvancedMarkerRef, // Connect marker to InfoWindow
useApiIsLoaded, // Check if API is loaded
} from '@vis.gl/react-google-maps';
// Enums
import {
ControlPosition, // For MapControl positioning
CollisionBehavior, // For marker collision handling
} from '@vis.gl/react-google-maps';
Critical Requirements
- mapId is required for AdvancedMarker - Create one at Google Cloud Console > Maps > Map Styles
- APIProvider must wrap all map components - Place at app root or layout level
- Circle, Polygon, Polyline are NOT exported - See
references/geometry-components.mdfor implementations - places.Autocomplete is deprecated (March 2025) - Use AutocompleteService with custom UI instead
Reference Files
Read these files based on the task:
| Task | Reference File |
|---|---|
| Map, Marker, InfoWindow, Pin details | references/components-api.md |
| useMap, useMapsLibrary, hooks | references/hooks-api.md |
| Circle, Polygon, Polyline | references/geometry-components.md |
| Places Autocomplete, Geocoding | references/places-autocomplete.md |
| Draggable markers + real-time sync, controlled maps | references/patterns.md |
Common Patterns
Marker with InfoWindow
const MarkerWithInfo = ({ position }: { position: google.maps.LatLngLiteral }) => {
const [markerRef, marker] = useAdvancedMarkerRef();
const [open, setOpen] = useState(false);
return (
<>
<AdvancedMarker ref={markerRef} position={position} onClick={() => setOpen(true)} />
{open && (
<InfoWindow anchor={marker} onClose={() => setOpen(false)}>
<p>Hello!</p>
</InfoWindow>
)}
</>
);
};
Draggable Marker with Real-Time Circle Sync
const DraggableWithCircle = () => {
const [position, setPosition] = useState({ lat: 18.4655, lng: -66.1057 });
return (
<>
<AdvancedMarker
position={position}
draggable
onDrag={(e) => {
// Updates DURING drag for real-time sync
if (e.latLng) setPosition({ lat: e.latLng.lat(), lng: e.latLng.lng() });
}}
/>
<Circle center={position} radius={1000} /> {/* Follows marker in real-time */}
</>
);
};
Custom Map Control
<Map {...props}>
<MapControl position={ControlPosition.TOP_LEFT}>
<button onClick={handleClick}>Custom Button</button>
</MapControl>
</Map>
TypeScript Types
// Position types
type LatLngLiteral = { lat: number; lng: number };
type LatLngAltitudeLiteral = { lat: number; lng: number; altitude: number };
// Event types
type MapMouseEvent = google.maps.MapMouseEvent;
type AdvancedMarkerClickEvent = google.maps.marker.AdvancedMarkerClickEvent;
// Library types (from useMapsLibrary)
type PlacesLibrary = google.maps.PlacesLibrary;
type GeocodingLibrary = google.maps.GeocodingLibrary;
type DrawingLibrary = google.maps.DrawingLibrary;
FAQ
What does the react-google-maps skill do?
Expert implementation of @vis.gl/react-google-maps library for Google Maps in React. Use when building maps, markers, pins, infowindows, places autocomplete, geocoding, draggable markers, polygons, circles, polylines, drawing tools, or any Google Maps JavaScript API integration in React/Next.js applications.
How do I install react-google-maps?
Run npx skills add https://github.com/horuz-ai/claude-plugins --skill react-google-maps in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/react-google-maps/ (personal) or .claude/skills/react-google-maps/ (project).
Which AI agents can use react-google-maps?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is react-google-maps safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains react-google-maps?
It is published by horuz-ai in horuz-ai/claude-plugins. It has 41 recorded installs.
More from horuz-ai/claude-plugins
website-cloner
horuz-ai/claude-plugins
Agentic workflow for cloning websites with pixel-perfect fidelity using specialized sub-agents. Use when the user wants to clone/copy/replicate a website, create a landing page based on an existing site, or needs to extract and recreate a website's design. Includes orchestration via slash command, four specialized sub-agents (screenshotter, extractor, cloner, qa-reviewer), and outputs React components with Tailwind CSS and motion animations.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.