Comments (10)
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.
Same here. The documentation is opaque at best. Please update it.
from google-maps-react.
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.
@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.
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.
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.
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.
Ditto. This documentation, and the use cases are brittle. Seems like there are constantly errors
from google-maps-react.
I agree. I am having hard time following the documentation as well. Maybe community can volunteer to maintain the documentation?
from google-maps-react.
@patelrohan I found this npm package useful as an alternative: https://github.com/istarkov/google-map-react
from google-maps-react.
Related Issues (20)
- How can I hide api key when inspecting on network? HOT 1
- cors error HOT 1
- prop-types should be a proper dependency
- Circle dragend event
- Unable to get marker coordinates on drag HOT 1
- Hide labels.text config on init Map
- is it possible to load geojson HOT 1
- Pin Drag Method Of Google map
- npm ERR ! HOT 1
- React cant compile anymore
- Please Update npmjs.com package to 2.0.8 its still 2.0.6 HOT 13
- Draw a route on the map HOT 1
- How to get the Current Zoom value on the Map? Is there any function to that?
- What is the difference between bounds and marginBounds?
- getting blank page maps not rendered
- Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<InfoWindow> & Readonly<IInfoWindowProps>'
- Exposing Google Map API key HOT 2
- Style the marker
- Updated version published as @peacechen/google-maps-react
- Custom styles not beign applied to map HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-maps-react.