Open source libraries

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

Web Components

Use Maps JavaScript API Web Components to quickly add maps functionality to your websites. Web Components encapsulate boilerplate code, best practices, and responsive design, reducing complex map UIs into what is effectively a single HTML element.

Google Maps Platform Extended Component Library is a set of Web Components that helps developers build better maps faster, and with less effort.

npm i @googlemaps/extended-component-library
NPM version for @googlemaps/extended-component-libraryNPM downloads for @googlemaps/extended-component-library GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

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
NPM version for @googlemaps/js-api-loaderNPM downloads for @googlemaps/js-api-loader GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

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
NPM version for @types/google.mapsNPM downloads for @types/google.maps GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

TypeScript guards to narrow union types.

npm i -D @googlemaps/typescript-guards
NPM version for @googlemaps/typescript-guardsNPM downloads for @googlemaps/typescript-guards GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

Using React

React users can get started with the following packages.

Components and hooks to integrate the Maps JavaScript API into React applications.

npm i -D @vis.gl/react-google-maps
NPM version for @vis.gl/react-google-mapsNPM downloads for @vis.gl/react-google-maps GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

A wrapper component to declaratively load the Maps JavaScript API.

npm i @googlemaps/react-wrapper
NPM version for @googlemaps/react-wrapperNPM downloads for @googlemaps/react-wrapper GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

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
NPM version for @googlemaps/markerclustererNPM downloads for @googlemaps/markerclusterer GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

Adds and removes markers based upon map viewport changes.

npm i @googlemaps/markermanager
NPM version for @googlemaps/markermanagerNPM downloads for @googlemaps/markermanager GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

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

npm i @googlemaps/ogc
NPM version for @googlemaps/ogcNPM downloads for @googlemaps/ogc GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

Add custom HTML labels to markers.

npm i @googlemaps/markerwithlabel
NPM version for @googlemaps/markerwithlabelNPM downloads for @googlemaps/markerwithlabel GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

Use WebGL and ThreeJS for high performance visualizations.

npm i @googlemaps/three
NPM version for @googlemaps/threeNPM downloads for @googlemaps/three GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

Use Deck.gl as a custom Google Maps overlay.

npm i @deck.gl/google-maps
NPM version for @deck.gl/google-mapsNPM downloads for @deck.gl/google-maps GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

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
NPM version for eslint-plugin-googlemapsNPM downloads for eslint-plugin-googlemaps GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

Mocks to use with the Jest testing library.

npm i -D @googlemaps/jest-mocks
NPM version for @googlemaps/jest-mocksNPM downloads for @googlemaps/jest-mocks GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

Node.js Libraries

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

npm i @googlemaps/google-maps-services-js
NPM version for @googlemaps/google-maps-services-jsNPM downloads for @googlemaps/google-maps-services-js GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

Encode and decode polylines in Node.js.

npm i @googlemaps/polyline-codec
NPM version for @googlemaps/polyline-codecNPM downloads for @googlemaps/polyline-codec GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge

Sign URLs in Node.js for additional security.

npm i @googlemaps/url-signature
NPM version for @googlemaps/url-signatureNPM downloads for @googlemaps/url-signature GitHub Repo starsGitHub commit activity (branch)GitHub forks Discord server badge
Design a Mobile Site
View Site in Mobile | Classic
Share by: