Core Components
These are the essential components you’ll use in almost every map implementation.GoogleMap
The main map container component that renders the Google Map instance
LoadScript
Load the Google Maps JavaScript API with proper configuration
Markers & Overlays
Components for adding interactive markers and visual elements to your map.Marker
Add markers to indicate points of interest on the map
InfoWindow
Display information windows attached to markers or positions
OverlayView
Create custom DOM-based overlays on the map
GroundOverlay
Display images overlaid on specific map coordinates
Drawing Components
Components for drawing shapes and paths on the map.Polyline
Draw lines connecting multiple points on the map
Polygon
Draw closed polygon shapes on the map
Circle
Draw circular areas on the map
Rectangle
Draw rectangular areas on the map
DrawingManager
Enable interactive drawing tools for users
Data & Visualization
Components for displaying data layers and visualizations.HeatmapLayer
Display heatmap visualizations of data density
Data
Display GeoJSON data on the map
KmlLayer
Display KML/KMZ files on the map
Map Layers
Pre-built layers for common map data.TrafficLayer
Display real-time traffic information
TransitLayer
Show public transit routes and stations
BicyclingLayer
Display bicycle routes and paths
Services
Components that provide Google Maps services functionality.DirectionsService
Calculate directions between locations
DirectionsRenderer
Display calculated directions on the map
DistanceMatrixService
Calculate travel distances and times between multiple points
Autocomplete
Add place autocomplete to input fields
StandaloneSearchBox
Standalone search box for places
Street View
Components for integrating Street View functionality.StreetViewPanorama
Display Google Street View panoramas
StreetViewService
Access Street View data programmatically
Advanced Features
Advanced components for complex use cases.MarkerClusterer
Group nearby markers into clusters for better performance
InfoBox
Customizable information boxes with advanced styling
Component Architecture
All components in this library follow consistent patterns:Context-Based
Components use React Context to access the map instance. Child components must be rendered within a<GoogleMap> component:
Lifecycle Callbacks
Most components provideonLoad and onUnmount callbacks to access the underlying Google Maps object:
Event Handlers
Components expose Google Maps events as React props with theon prefix:
TypeScript Support
All components are fully typed with TypeScript. Import types from the package:Getting Started
To start using these components:- Load the Google Maps API using
LoadScriptorLoadScriptNext - Render a map using the
GoogleMapcomponent - Add child components for markers, overlays, and other features
Quick Start Guide
Learn how to set up your first map