google-maps-react icon indicating copy to clipboard operation
google-maps-react copied to clipboard

Unclear documentation

Open g0ddish opened this issue 10 years ago • 10 comments

I've read through the code for the demo, the documentation and I still don't have a clear understanding of required google prop. I think replacing this joke line with a more clear breakdown would help people trying to use this project. Thanks.

The component requires a google prop be included to work. Without the google prop, it will explode.

g0ddish avatar Oct 10 '16 21:10 g0ddish

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

HZSamir avatar Oct 16 '16 11:10 HZSamir

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.

dancre avatar Oct 18 '16 10:10 dancre

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

auser avatar Oct 21 '16 10:10 auser

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

vasanth-mahendran avatar Oct 24 '16 02:10 vasanth-mahendran

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.

tzerb avatar Nov 28 '16 06:11 tzerb

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

dancre avatar Nov 28 '16 19:11 dancre

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

njho avatar Jun 16 '17 23:06 njho

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);

andy-pro avatar Jul 02 '17 12:07 andy-pro

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

patelrohan avatar Mar 09 '18 22:03 patelrohan

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

dancre avatar Mar 10 '18 02:03 dancre