/google-map-with-hooks

Google Map in ReactJS.

Primary LanguageJavaScript

Google Map

  • Add Google Map in ReactJS.
  • Auto-fit map and remove old markers when data changes.
  • Set Active/Inactive markers on selection.
  • Get ID of selected marker from map.
  • Center and zoom map when selected from list.
  • Attach events to map and markers.
  • Add InfoWindow.

Demo

CodeSandbox Link

Quick Start

  • Clone, npm i and npm start to just run the project.
  • If you want to add Google Map to other project then copy files of /map folder to your directory. Change LocationMap.js according to your need.
  • Add map key to your environments.

Dependency

google-maps-api-loader

Reference

Google Map hooks reference