foliumap module¶
FoliumMap
¶
Source code in geobay\foliumap.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |
__init__(location, zoom_start=3, **kwargs)
¶
Initializes a folium map centered at a given location with a specified zoom level.
Parameters: location (tuple): Latitude and longitude coordinates for the map center. zoom_start (int): The initial zoom level of the map.
Source code in geobay\foliumap.py
5 6 7 8 9 10 11 12 13 | |
add_basemap(basemap='OpenStreetMap')
¶
Adds a basemap to the folium map.
Parameters: basemap (str): The name of the basemap to add (e.g., 'OpenStreetMap', 'Stamen Terrain', etc.).
Source code in geobay\foliumap.py
15 16 17 18 19 20 21 22 23 24 25 26 27 | |
add_layer_control()
¶
Adds a layer control widget to the folium map for toggling layers.
Source code in geobay\foliumap.py
29 30 31 32 33 | |
add_split_map(left_layer='OpenStreetMap', right_layer='Stamen Terrain')
¶
Adds a side-by-side split view of two different tile layers.
Parameters: left_layer (str): Basemap name for the left side. right_layer (str): Basemap name for the right side.
Source code in geobay\foliumap.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
add_vector(geo_data)
¶
Adds vector data (GeoJSON or other formats supported by GeoPandas) to the map.
Parameters: geo_data (GeoDataFrame or str): A GeoDataFrame or a path to a GeoJSON file.
Source code in geobay\foliumap.py
35 36 37 38 39 40 41 42 43 44 | |
show_map()
¶
Displays the folium map in the Jupyter notebook or Python script.
Source code in geobay\foliumap.py
82 83 84 85 86 | |