MCPcopy
hub / github.com/python-visualization/folium / __init__

Method __init__

folium/folium.py:261–348  ·  view source on GitHub ↗
(
        self,
        location: Optional[Sequence[float]] = None,
        width: Union[str, float] = "100%",
        height: Union[str, float] = "100%",
        left: Union[str, float] = "0%",
        top: Union[str, float] = "0%",
        position: str = "relative",
        tiles: Union[str, TileLayer, None] = "OpenStreetMap",
        attr: Optional[str] = None,
        min_zoom: Optional[int] = None,
        max_zoom: Optional[int] = None,
        zoom_start: int = 10,
        min_lat: float = -90,
        max_lat: float = 90,
        min_lon: float = -180,
        max_lon: float = 180,
        max_bounds: bool = False,
        crs: str = "EPSG3857",
        control_scale: bool = False,
        prefer_canvas: bool = False,
        no_touch: bool = False,
        disable_3d: bool = False,
        png_enabled: bool = False,
        zoom_control: Union[bool, str] = True,
        font_size: str = "1rem",
        **kwargs: TypeJsonValue,
    )

Source from the content-addressed store, hash-verified

259 default_css = _default_css
260
261 def __init__(
262 self,
263 location: Optional[Sequence[float]] = None,
264 width: Union[str, float] = "100%",
265 height: Union[str, float] = "100%",
266 left: Union[str, float] = "0%",
267 top: Union[str, float] = "0%",
268 position: str = "relative",
269 tiles: Union[str, TileLayer, None] = "OpenStreetMap",
270 attr: Optional[str] = None,
271 min_zoom: Optional[int] = None,
272 max_zoom: Optional[int] = None,
273 zoom_start: int = 10,
274 min_lat: float = -90,
275 max_lat: float = 90,
276 min_lon: float = -180,
277 max_lon: float = 180,
278 max_bounds: bool = False,
279 crs: str = "EPSG3857",
280 control_scale: bool = False,
281 prefer_canvas: bool = False,
282 no_touch: bool = False,
283 disable_3d: bool = False,
284 png_enabled: bool = False,
285 zoom_control: Union[bool, str] = True,
286 font_size: str = "1rem",
287 **kwargs: TypeJsonValue,
288 ):
289 super().__init__()
290 self._name = "Map"
291
292 self._png_image: Optional[bytes] = None
293 self.png_enabled = png_enabled
294
295 if location is None:
296 # If location is not passed we center and zoom out.
297 self.location = [0.0, 0.0]
298 zoom_start = 1
299 else:
300 self.location = validate_location(location)
301
302 Figure().add_child(self)
303
304 # Map Size Parameters.
305 self.width = _parse_size(width)
306 self.height = _parse_size(height)
307 self.left = _parse_size(left)
308 self.top = _parse_size(top)
309 self.position = position
310 self.font_size = parse_font_size(font_size)
311
312 max_bounds_array = (
313 [[min_lat, min_lon], [max_lat, max_lon]] if max_bounds else None
314 )
315
316 self.crs = crs
317 self.control_scale = control_scale
318

Callers 1

__init__Method · 0.45

Calls 6

validate_locationFunction · 0.90
parse_font_sizeFunction · 0.90
remove_emptyFunction · 0.90
TileLayerClass · 0.90
GlobalSwitchesClass · 0.85
add_childMethod · 0.45

Tested by

no test coverage detected