Gathering detailed insights and metrics for @vis.gl/react-google-maps
Gathering detailed insights and metrics for @vis.gl/react-google-maps
Gathering detailed insights and metrics for @vis.gl/react-google-maps
Gathering detailed insights and metrics for @vis.gl/react-google-maps
React components and hooks for the Google Maps JavaScript API
npm install @vis.gl/react-google-maps
Typescript
Module System
Node Version
NPM Version
94.6
Supply Chain
94.8
Quality
91.4
Maintenance
100
Vulnerability
100
License
TypeScript (86.67%)
JavaScript (10.83%)
MDX (1.23%)
CSS (0.84%)
Shell (0.43%)
Total Downloads
12,361,640
Last Day
9,955
Last Week
363,795
Last Month
1,577,310
Last Year
11,498,807
MIT License
1,660 Stars
427 Commits
157 Forks
18 Watchers
7 Branches
49 Contributors
Updated on Jul 01, 2025
Minified
Minified + Gzipped
Latest Version
1.5.3
Package Id
@vis.gl/react-google-maps@1.5.3
Unpacked Size
782.10 kB
Size
196.18 kB
File Count
113
NPM Version
10.8.2
Node Version
20.19.1
Published on
Jun 05, 2025
Cumulative downloads
Total Downloads
Last Day
-6.4%
9,955
Compared to previous day
Last Week
-9.6%
363,795
Compared to previous week
Last Month
-0.6%
1,577,310
Compared to previous month
Last Year
1,232.7%
11,498,807
Compared to previous year
2
24
This is a TypeScript / JavaScript library to integrate the Maps JavaScript API into your React application. It comes with a collection of React components to create maps, markers and infowindows, and a set of hooks to use some of the Maps JavaScript API Services and Libraries.
This library is available on npm as @vis.gl/react-google-maps
.
1npm install @vis.gl/react-google-maps
or
1yarn add @vis.gl/react-google-maps
(PowerShell users: since @
has a special meaning in PowerShell, the
package name has to be quoted)
Import the APIProvider
and wrap it around all components that should have
access to the Maps JavaScript API.
Any component within the context of the APIProvider
can use the hooks and
components provided by this library.
To render a simple map, add a Map
component inside the APIProvider
.
Within the Map
component, you can then add further components like
Marker
, AdvancedMarker
, or
InfoWindow
to render content on the map.
For more advanced use-cases you can even add your own components to the map
that make use of google.maps.OverlayView
or google.maps.WebGlOverlayView
.
1import {AdvancedMarker, APIProvider, Map} from '@vis.gl/react-google-maps'; 2 3function App() { 4 const position = {lat: 53.54992, lng: 10.00678}; 5 6 return ( 7 <APIProvider apiKey={'YOUR API KEY HERE'}> 8 <Map defaultCenter={position} defaultZoom={10} mapId="DEMO_MAP_ID"> 9 <AdvancedMarker position={position} /> 10 </Map> 11 </APIProvider> 12 ); 13} 14 15export default App;
Please see our documentation or examples for more in-depth information about this library.
Besides rendering maps, the Maps JavaScript API has a lot of additional libraries for things like geocoding, routing, the Places API, Street View, and a lot more.
These libraries are not loaded by default, which is why this module provides
the useMapsLibrary()
hook to handle dynamic loading of
additional libraries.
For example, if you just want to use the google.maps.geocoding.Geocoder
class in
a component and you don't even need a map, it can be implemented like this:
1import {useMap, useMapsLibrary} from '@vis.gl/react-google-maps'; 2 3const MyComponent = () => { 4 // useMapsLibrary loads the geocoding library, it might initially return `null` 5 // if the library hasn't been loaded. Once loaded, it will return the library 6 // object as it would be returned by `await google.maps.importLibrary()` 7 const geocodingLib = useMapsLibrary('geocoding'); 8 const geocoder = useMemo( 9 () => geocodingLib && new geocodingLib.Geocoder(), 10 [geocodingLib] 11 ); 12 13 useEffect(() => { 14 if (!geocoder) return; 15 16 // now you can use `geocoder.geocode(...)` here 17 }, [geocoder]); 18 19 return <></>; 20}; 21 22const App = () => { 23 return ( 24 <APIProvider apiKey={'YOUR API KEY HERE'}> 25 <MyComponent /> 26 </APIProvider> 27 ); 28};
Explore our examples directory on GitHub or the examples on our website for full implementation examples.
Being a library built around the Google Maps JavaScript API, we follow the same browser-support policy as the Google Maps Team, available here. Generally, the last two versions of the major browsers are officially supported.
It is not unlikely that browsers even far outside the given range will still work. We try our best to support as many browsers and versions as reasonably possible, but we won't actively investigate issues related to outdated browser versions.
However, if you can suggest small changes that could be made to even increase that range, we will be happy to include them, as long as they don't negatively affect the supported browsers.
@vis.gl/react-google-maps
uses Google Maps Platform services. Use of Google
Maps Platform services through this library is subject to the
Google Maps Platform Terms of Service.
This library is not a Google Maps Platform Core Service. Therefore, the Google Maps Platform Terms of Service (e.g., Technical Support Services, Service Level Agreements, and Deprecation Policy) do not apply to this library.
This library is offered via an open source license. It is not governed by the Google Maps Platform Technical Support Services Guidelines, the SLA, or the Deprecation Policy (however, any Google Maps Platform services used by this library remain subject to the Google Maps Platform Terms of Service).
If you find a bug or have a feature request, please file an issue on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, feel free to open a thread in the discussions section on GitHub or ask a question through one of our developer community channels.
If you'd like to contribute, please check the Contributing guide.
You can also discuss this library on our Discord server.
No vulnerabilities found.
No security vulnerabilities found.