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

Best way to interact with layers #34

Closed
hokkos opened this issue May 19, 2015 · 1 comment
Closed

Best way to interact with layers #34

hokkos opened this issue May 19, 2015 · 1 comment

Comments

@hokkos
Copy link

hokkos commented May 19, 2015

Hi,
thanks for your lib,
I wonder what is the best way to to interact with vector layers, for now I use ref in the component that contains the map on the layers to access leafletElement to be able to do :

this.map.getLeafletElement().fitBounds(this.refs.circle.leafletElement.getBounds())

I could compute the bounds but it would duplicate the complexity already handled by leaflet.
Or maybe should I subclass the Circle component, and make it a "connected component" that handle it himself.
Any idea ?
Thanks.

@PaulLeCam
Copy link
Owner

It really depends on your use case, if you're using Flux you would likely have the properties of your circle set in a store, so it would make sense to update the map based on these values as well.
If your map layers are your sources of truth, your solution seems good.

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

2 participants