Closed mikefowler closed 9 years ago
You can access them directly through refs
, as it's shown here: https://github.com/tomchentw/react-google-maps/issues/17
I took a day to rewrite the module from scratch on #88 . However, I remove these method from the component APIs. Do you guys think it's a good idea to remove it or keep it?
I have a use case for using fitBounds. Do you expose the google map object so that it would be possible to act directly on it? Or is that philosophically improper?
It's not a easy design decision and I certainly believe exposing it is philosophically improper. But I cannot come up with a better way other than exposing getter though ...
I would be in favor of exposing it recognizing that even though it may be improper it may be the only way to achieve something that would otherwise require scrapping the use of the project altogether. :)
Now with the rewrite, I'm pretty confused on what the correct way to use these is... especially fitBounds. I assume that panBounds is useless to set since I assume a new map is created every time state changes (is that right?). But setting fitBounds doesn't seem to actually work. Could you give us an example of how we should be setting the bounds? Thanks for this great project!
State changes will only be applied when you have controlled properties. Try calling fitBounds in your cDU?
isn't fitbounds a controlled property?
@outdooricon it's public APIs from the ref
: http://git.io/vGc4H
Ok, I think i understand. I'm really curious what the use case of even exposing the these other properties that @LarryEitel has. It's pretty confusing to expose these if they don't really work.
Could you provide some more documentation on how to use these
<GoogleMaps />
helper methods?