Giter Club home page Giter Club logo

Comments (10)

andy-pro avatar andy-pro commented on May 17, 2024 1

Very quick start:

import React from 'react';
import Map, { GoogleApiWrapper } from 'google-maps-react';

class SimpleMapPage extends React.Component {
  render() {
    return (
      <Map
        google={this.props.google}
        zoom={14}
        center={{
          lat: 37.774929,
          lng: -122.419416,
        }}
      />
    );
  }
}

export default GoogleApiWrapper({
  apiKey: YOUR_API_KEY,
})(SimpleMapPage);

from google-maps-react.

HZSamir avatar HZSamir commented on May 17, 2024

Same here. The documentation is opaque at best. Please update it.

from google-maps-react.

dancre avatar dancre commented on May 17, 2024

I'm having trouble following the blog post for this - maybe I need to give it another go. I actually found just reading through the documentation a lot more helpful than the blog post - which seems to be missing steps to get a working solution.

Would be great to get some improvements here as this is the most promising source I have found for implementing google maps + react.

from google-maps-react.

auser avatar auser commented on May 17, 2024

@g0ddish want to make a PR? I'll go through and update the README (and blog post) with these thoughts in mind.

from google-maps-react.

vasanth-mahendran avatar vasanth-mahendran commented on May 17, 2024

Can you please let me know how to set this prop google. I have gone through the examples. still couldn't able to find

from google-maps-react.

tzerb avatar tzerb commented on May 17, 2024

I just worked through this and it did take me longer than it should have to get started. Is the problem here that container.js in the example uses the project source instead of the npm package?

if (IS_DEV) {
GoogleApiWrapper = require('../src/index').GoogleApiWrapper
} else {
GoogleApiWrapper = require('../dist').GoogleApiWrapper
}

That's what confused me, anyway.

If there is any interest, I could make a free standing example using the latest npm package and also include a warning about supplying your own api key.

from google-maps-react.

dancre avatar dancre commented on May 17, 2024

Hi @tzerb

I gave up on using this library and implemented my own more much more basic solution - but would love to see a simple example of this implemented in a working state using npm as you mentioned! As have been meaning to give it another try at some point.

By the sounds of it others will find this pretty useful too!

Thanks

from google-maps-react.

njho avatar njho commented on May 17, 2024

Ditto. This documentation, and the use cases are brittle. Seems like there are constantly errors

from google-maps-react.

patelrohan avatar patelrohan commented on May 17, 2024

I agree. I am having hard time following the documentation as well. Maybe community can volunteer to maintain the documentation?

from google-maps-react.

dancre avatar dancre commented on May 17, 2024

@patelrohan I found this npm package useful as an alternative: https://github.com/istarkov/google-map-react

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.