-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Zoom to Overlay Selection #1317
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
Conversation
Hi @galewis2 , I know this is still a draft but I already wanted to give some comments and questions, help develop this. I like the idea of detecting whether a layer has the I'm not sure about adding a FeatureGroup on the fly, it seems unrobust. We already have a list of layers in I don't know if we need to do anything on We can discuss this of course. I'm looking forward to your next changes on this. By the way don't worry about tests for this. When it's finished we can add an example to an existing or new Jupyter notebook. We'll test those. |
No problem, that was just a quick hack that I forgot to add to the todo list. I wanted a quick method whereby I got the bounds of all layers in one call without doing any sort of max/min bbox calculations
I guess this is a user expectation and use-case question. Should the map on layer (de)select be constrained to those layers?
|
From what I can tell, I'm going to switch from an on-the-fly FeatureGroup to a LatLngBounds objects and do extend on that. Same outcome, but simpler object and more refined for how it's being used. |
@Conengmo Ready for further discussion about implementation. |
I just tested your current implementation and it works great. I know I said this before but I like how this works for any layer with Some more detailed questions/comments:
I was looking in what example notebook we can showcase this. I don't think it fits in any existing one. Maybe create a new one? I'm working on testing the notebooks in our test suite, so that will be the test case for this feature. |
I'm happy with the default padding. The only issue I can see is that markers may be cutoff when at the top of the map, but I decided to leave it as is as they have a static size in the browser so setting a padding may be tricky.
Done.
Done.
Seems okay to me, done.
I attempted to do this now, but I think I'm running into the problem where firing a flyto on load for the map object wasn't working as the layers weren't initially added to the map. Which also requires the layers to be defined in the map object. At this stage I think it would be a pain to implement when there's a workaround of getting all the layerbounds in python and applying that manually on map instantiation
|
Code looks good! We're very close. Three comments: This doesn't work with all types of layers, for example Heatmap. I'm okay with that. But maybe good to add a line to the docstring that warns users it may not work for all layer types. One thing I tried to get it to apply this on map load was:
This works because LayerControl is added to the map after the layers it controls are. So at the point where we call this function the layers must already have been added to the map. What do you think of this? Now the only thing that remains is add a test case. Please rebase or merge master into your branch. Then add a new notebook, I'd suggest |
Sounds good, hopefully I will get some time to look at it this week! |
WIP.
Just to track what I'm working on. This is related to #1313
Move to a plugin