Back to Skills

react-google-maps

verified

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.

View on GitHub

Marketplace

horuz

horuz-ai/claude-plugins

Plugin

google

Repository

horuz-ai/claude-plugins
1stars

plugins/google/skills/react-google-maps/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/horuz-ai/claude-plugins/blob/main/plugins/google/skills/react-google-maps/SKILL.md -a claude-code --skill react-google-maps

Installation paths:

Claude
.claude/skills/react-google-maps/
Powered by add-skill CLI

Instructions

# @vis.gl/react-google-maps

Official React library for Google Maps JavaScript API, maintained by vis.gl with Google sponsorship.

## Quick Start

```tsx
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

```bash
npm install @vis.gl/react-google-maps
```

## Key Exports

```tsx
// 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

1. **mapId is required for AdvancedMarker** - Create one at Google Cloud Console > Maps > Map Styles
2. **APIProvider must wrap all map components** - Place at app root or layout level
3. **Circle, Polygon, Polyline are NOT exported** - S

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3982 chars