Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing google.maps.Map Object, yet another case #239

Closed
deflexor opened this issue Apr 5, 2016 · 2 comments
Closed

Accessing google.maps.Map Object, yet another case #239

deflexor opened this issue Apr 5, 2016 · 2 comments

Comments

@deflexor
Copy link

deflexor commented Apr 5, 2016

For example i has one component <MyMap/>, which contains <GoogleMap/>. And now i need another component <PlaceFineder/> which uses google.maps.places.PlacesService which requires google.maps.Map object. So is there possibility to pass google.maps.Map from <MyMap/> component to <PlaceFineder/> component ? Something like:

<MyMap ref="mymap" />
...
<PlaceFinder map={this.refsmymap.props.map} />

this although should work, but not applicable in my case, is there another way ?

@indurnath
Copy link

If you need a reference of map object, You can try like this:
ref={googleMap => {
if (!googleMap) {
return ;
}
console.log(googleMap);
this.gmap = googleMap;
} }
this.gmap.props.map will give you the reference to map .

@tomchentw
Copy link
Owner

We're going to look into this shortly.

We're also looking for maintainers. Involve in #266 to help strengthen our community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants