Skip to content

matejdostal/reusable-google-map-react-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reusable <GoogleMap /> component for React apps...

import GoogleMap, { initializeApi } from "./GoogleMap";


// api initialization
initializeApi(
    {
        // loaderOptions - https://googlemaps.github.io/js-api-loader/interfaces/loaderoptions.html
        apiKey: "{GOOGLE_MAPS_JS_API_KEY}"
    },
    {
        // defaultMapOptions - https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions
    }
);


// component usage
const createMapHandler = (map) => { ... }
const destroyMapHandler = (map) => { ... }
const mapOptions = { ... }

//...

<GoogleMap onCreate={createMapHandler} onDestroy={destroyMapHandler} mapOptions={mapOptions} />

About

Reusable Google maps Map component for React apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published