visgl / react-google-maps

React components and hooks for the Google Maps JavaScript API
https://visgl.github.io/react-google-maps/
MIT License
1.31k stars 111 forks source link

[Feat] Add example of how to use controlled map with mouse drag #296

Closed wilson-nickolas closed 7 months ago

wilson-nickolas commented 7 months ago

Target Use Case

Learning / Documentation.

Proposal

There is no example of controlled map usage that shows how to correctly use the library with mouse drag events. So it would be helpful to many people to see how this is correctly done.

usefulthink commented 7 months ago

We have an example with fully controlled maps here: https://visgl.github.io/react-google-maps/examples/multiple-maps

Is that what you're looking for or am I misunderstanding?

wilson-nickolas commented 7 months ago

@usefulthink Thanks for the link. I just took a quick look over it and it seems to confirm what I had setup. So perhaps I should be making a bug issue. Basically, I'm experiencing no new onCameraChanged events from cursor/drag movement using controlled map latest version with deck.gl.

Any advice is greatly appreciated.

usefulthink commented 7 months ago

Please do! The deck.gl integration (when using deck as controlling component) has a slightly different code-path, might be we missed something around there.

wilson-nickolas commented 7 months ago

Please do! The deck.gl integration (when using deck as controlling component) has a slightly different code-path, might be we missed something around there.

Cheers, I do that then first thing tomorrow. Thanks for your help.

qiaoxin136 commented 2 months ago

I am interested in the same topic. How do i add deck.gl into this controlled map example with multiple synchronous maps? Did you have another example somewhere? Thanks. It is a great work.