Unclear documentation
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.
Same here. The documentation is opaque at best. Please update it.
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.
@g0ddish want to make a PR? I'll go through and update the README (and blog post) with these thoughts in mind.
Can you please let me know how to set this prop google. I have gone through the examples. still couldn't able to find
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.
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
Ditto. This documentation, and the use cases are brittle. Seems like there are constantly errors
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);
I agree. I am having hard time following the documentation as well. Maybe community can volunteer to maintain the documentation?
@patelrohan I found this npm package useful as an alternative: https://github.com/istarkov/google-map-react