~pythonxy/pythonxy-upstream/geopandas

« back to all changes in this revision

Viewing changes to geopandas/explore.py

  • Committer: GitHub
  • Author(s): rraymondgh
  • Date: 2022-01-27 07:22:43 UTC
  • Revision ID: git-v1:f990008d90fa09e60c33d29d61c7dbebc134b6ab
ENH: expose folium.map kwds as map_kwds in `explore()` (#2315)

Co-authored-by: Martin Fleischmann <martin@martinfleischmann.net>

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
    tooltip_kwds={},
58
58
    popup_kwds={},
59
59
    legend_kwds={},
 
60
    map_kwds={},
60
61
    **kwargs,
61
62
):
62
63
    """Interactive map based on GeoPandas and folium/leaflet.js
225
226
            Applies if ``colorbar=False``.
226
227
        max_labels : int, default 10
227
228
            Maximum number of colorbar tick labels (requires branca>=0.5.0)
 
229
    map_kwds : dict (default {})
 
230
        Additional keywords to be passed to folium :class:`~folium.folium.Map`,
 
231
        e.g. ``dragging``, or ``scrollWheelZoom``.
 
232
 
228
233
 
229
234
    **kwargs : dict
230
235
        Additional options to be passed on to the folium object.
302
307
            fit = False
303
308
 
304
309
        # get a subset of kwargs to be passed to folium.Map
305
 
        map_kwds = {i: kwargs[i] for i in kwargs.keys() if i in _MAP_KWARGS}
 
310
        for i in _MAP_KWARGS:
 
311
            if i in map_kwds:
 
312
                raise ValueError(
 
313
                    f"'{i}' cannot be specified in 'map_kwds'. "
 
314
                    f"Use the '{i}={map_kwds[i]}' argument instead."
 
315
                )
 
316
        map_kwds = {
 
317
            **map_kwds,
 
318
            **{i: kwargs[i] for i in kwargs.keys() if i in _MAP_KWARGS},
 
319
        }
306
320
 
307
321
        if HAS_XYZSERVICES:
308
322
            # match provider name string to xyzservices.TileProvider