Open source libraries

Many open source libraries are available to provide additional functionality for Maps JavaScript API. These libraries are versioned on GitHub and published to NPM.

Loading the API

Modern web applications may benefit from using the following libraries to load the Maps JavaScript API.

Dynamically load the Maps JavaScript API with Promises.

npm i @googlemaps/js-api-loader

A wrapper component to declaratively load the Maps JavaScript API.

npm i @googlemaps/react-wrapper

Using TypeScript

TypeScript users can get started with the following packages. Check out the using TypeScript guide for additional information.

TypeScript types for Maps JavaScript API

npm i -D @types/google.maps

TypeScript guards to narrow union types.

npm i -D @googlemaps/typescript-guards

Extending markers and overlays

The following libraries extend classes such as Marker and OverlayView.

Creates and manages per-zoom-level clusters for large amounts of markers.

npm i @googlemaps/markerclusterer

Adds and removes markers based upon map viewport changes.

npm i @googlemaps/markermanager

Add Open Geospatial Consortium (OGC) layers such as a Web Map Service (WMS) to a map.

npm i @googlemaps/ogc

Add custom HTML labels to markers.

npm i @googlemaps/markerwithlabel

Use WebGL and ThreeJS for high performance visualizations.

npm i @googlemaps/three

Use Deck.gl as a custom Google Maps overlay.

npm i @deck.gl/google-maps

Testing and linting

Use these libraries to ensure best practices and make testing easier for the Maps JavaScript API.

Use custom ESLint rules to lint your code.

npm i -D eslint-plugin-googlemaps

Mocks to use with the Jest testing library.

npm i -D @googlemaps/jest-mocks

NodeJS Libraries

NodeJS client library for making calls from cloud functions or serverside code.

npm i @googlemaps/google-maps-services-js

Encode and decode polylines in NodeJS.

npm i @googlemaps/polyline-codec

Sign urls in NodeJS for additional security.

npm i @googlemaps/url-signature