Skip to content

The JavaScript library to easily implement a Google Maps map into your react application. It comes with a collection of React hooks to access the map instance or different Maps JavaScript Services.

License

Notifications You must be signed in to change notification settings

ubilabs/google-maps-react-hooks

Repository files navigation

Google Maps React Hooks

npm version GitHub license

Description

This is a JavaScript library to easily implement a Google Maps map into your React application. It comes with a collection of React hooks to access the Google Maps map instance all over your components and to use some of the Google Maps Services or Libraries.

Table of contents

Development (only for Maintainers)

Clone the repository and run

npm install

in the project root to install all dependencies.

Library

To develop the Google Maps React Hooks library, start the project locally with

npm run start:library

Examples

To develop one of the examples, you have to create a .env file in the /examples directory first and add your Google Maps API key to it in the following format:

GOOGLE_MAPS_API_KEY="<YOUR API KEY HERE>"

An example can be found in /examples/.env.example.

Start the example locally with the appropriate task, e.g. npm run start:map-example. You can find the right task in the README of the example you want to start.

The example runs on localhost:1234.

Contribution

We are happy about your contribution. Please checkout the following guide to get started: Contribution Guide.

Also, make sure to follow our Coding Conventions when making commits.

Publish library on npm

A new library version is automatically published by Github Actions as soon as a new version tag is available. To trigger a new release, run:

npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git] -w library

NOTE: Make sure to not forget setting the context to the library workspace with -w library when running the command from project root.

About

The JavaScript library to easily implement a Google Maps map into your react application. It comes with a collection of React hooks to access the map instance or different Maps JavaScript Services.

Topics

Resources

License

Stars

Watchers

Forks

Packages