Giter Club home page Giter Club logo

Comments (4)

alexanderwhatley avatar alexanderwhatley commented on May 19, 2024

I would like to knonw this as well. It seems that it is somehow passed in through the this.props.google item, but I am not sure what that is, or how to use it...

from google-maps-react.

tzerb avatar tzerb commented on May 19, 2024

There is a file in the root of the project called '.env.example'. Place your key in this file and rename to '.env'. (I have single quotes around my key but I'm not sure if that necessary.)

If you're still having trouble, check out the stand alone project in the 'GettingStarted' folder here: 'https://github.com/tzerb/google-maps-react'

from google-maps-react.

wedneyyuri avatar wedneyyuri commented on May 19, 2024

It's on README: https://github.com/fullstackreact/google-maps-react#automatically-lazy-loading-google-api

Automatically Lazy-loading Google API

The library includes a helper to wrap around the Google maps API. The GoogleApiWrapper Higher-Order component accepts a configuration object which must include an apiKey. See lib/GoogleApi.js for all >options it accepts.

import {GoogleApiWrapper} from 'GoogleMapsReactComponent'

// ...

export class Container extends React.Component {}

export default GoogleApiWrapper({
 apiKey: __GAPI_KEY__
})(Container)

The GoogleApiWrapper automatically passes the google instance loaded when the component mounts (and will only load it once).

Manually loading the Google API

If you prefer not to use the automatic loading option, you can also pass the window.google instance as a prop to your <Map /> component.

from google-maps-react.

andy-pro avatar andy-pro commented on May 19, 2024

Look at here

from google-maps-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.