Added typehints to the foliumap.Map init
As discussed in my previous PR: here a PR with just the Init updates on foliumap.Map. This enhances the docs popup in IDEs:
Initially, I removed the **kwargs completely, but now I realize that shouldn't be the case.
Firstly, this change causes the docs builder to crash since ipyleaflet parameters are added to a foliumap in some places. Secondly, it removes the ability to use folium.Map parameters that are not part of the foliumap.Map class.
For now i have reintroduced the **kwargs and placed them bank in the super.init
I might be missing something, so please review this PR critically 😄
Some parameter names are different between folium and ipylealet, such as location vs center, and zoom_start vs zoom. The kwargs allows those parameters to be interchangerable.
Yes, I figured. That why I have this mapping: super().init( location=center, zoom_start=zoom, min_zoom=min_zoom, max_zoom=max_zoom, control_scale=scale_control, height=height, width=width, **kwargs, )
This seems to works, but the problem might be that the current selection of parameters might imply that those are the only options, while it is still possible to pass folium Map parameters (for example crs, no_touch etc.).
Maybe the best option here is to add them all to the foliumap.Map, to make sure the IDE shows all available parameters. By still leaving the **kwargs in, it should work completely interchangerable with ipyleaflet, while having a 100% covered IDE doc popup for all parameters that actually work for Folium.
I could extend this PR later this week.
I did some prunning to reduce the repo size from 1.6 GB to 250 MB. The seems to have caused issues for your PR. Sorry about that. You might want to clone the repo again and create a new branch. Then just overwrite the few files you have modified. This is can avoid the merge conflict issue.
Your pull request are in conflict @JJFlorian, please fix it!
@JJFlorian Sorry to close the PR for now. Otherwise, you will keep receiving the merge conflict notifications from pre-commit. If you want to continue the work, please clone the repo again and overwrite the folium.py. Sorry for the inconvience.