geemap/geemap.py
def add_shapefile(
        self,
        in_shp,
        layer_name="Untitled",
        style={},
        hover_style={},
        style_callback=None,
        fill_colors=["black"],
        info_mode="on_hover",
    ):
        """Adds a shapefile to the map.

        Args:
            in_shp (str): The input file path to the shapefile.
            layer_name (str, optional): The layer name to be used.. Defaults to "Untitled".
            style (dict, optional): A dictionary specifying the style to be used. Defaults to {}.
            hover_style (dict, optional): Hover style dictionary. Defaults to {}.
            style_callback (function, optional): Styling function that is called for each feature, and should return the feature style. This styling function takes the feature as argument. Defaults to None.
            fill_colors (list, optional): The random colors to use for filling polygons. Defaults to ["black"].
            info_mode (str, optional): Displays the attributes by either on_hover or on_click. Any value other than "on_hover" or "on_click" will be treated as None. Defaults to "on_hover".

        Raises:
            FileNotFoundError: The provided shapefile could not be found.
        """
        in_shp = os.path.abspath(in_shp)
        if not os.path.exists(in_shp):
            raise FileNotFoundError("The provided shapefile could not be found.")

        geojson = shp_to_geojson(in_shp)
        self.add_geojson(
            geojson,
            layer_name,
            style,
            hover_style,
            style_callback,
            fill_colors,
            info_mode,
        )
Adds a shapefile to the map.

        Args:
            in_shp (str): The input file path to the shapefile.
            layer_name (str, optional): The layer name to be used.. Defaults to "Untitled".
            style (dict, optional): A dictionary specifying the style to be used. Defaults to {}.
            hover_style (dict, optional): Hover style dictionary. Defaults to {}.
            style_callback (function, optional): Styling function that is called for each feature, and should return the feature style. This styling function takes the feature as argument. Defaults to None.
            fill_colors (list, optional): The random colors to use for filling polygons. Defaults to ["black"].
            info_mode (str, optional): Displays the attributes by either on_hover or on_click. Any value other than "on_hover" or "on_click" will be treated as None. Defaults to "on_hover".

        Raises:
            FileNotFoundError: The provided shapefile could not be found.
        
Adds a shapefile to the map.
Adds a shapefile to the map .
def add_shapefile(
        self,
        in_shp,
        layer_name="Untitled",
        style={},
        hover_style={},
        style_callback=None,
        fill_colors=["black"],
        info_mode="on_hover",
    ):
        in_shp = os.path.abspath(in_shp)
        if not os.path.exists(in_shp):
            raise FileNotFoundError("The provided shapefile could not be found.")
        geojson = shp_to_geojson(in_shp)
        self.add_geojson(
            geojson,
            layer_name,
            style,
            hover_style,
            style_callback,
            fill_colors,
            info_mode,
        )
def add_shapefile ( self , in_shp , layer_name = "Untitled" , style = { } , hover_style = { } , style_callback = None , fill_colors = [ "black" ] , info_mode = "on_hover" , ) : in_shp = os . path . abspath ( in_shp ) if not os . path . exists ( in_shp ) : raise FileNotFoundError ( "The provided shapefile could not be found." ) geojson = shp_to_geojson ( in_shp ) self . add_geojson ( geojson , layer_name , style , hover_style , style_callback , fill_colors , info_mode , )
Adds a shapefile to the map.
Adds a shapefile to the map .
"""Adds a shapefile to the map.

        Args:
            in_shp (str): The input file path to the shapefile.
            layer_name (str, optional): The layer name to be used.. Defaults to "Untitled".
            style (dict, optional): A dictionary specifying the style to be used. Defaults to {}.
            hover_style (dict, optional): Hover style dictionary. Defaults to {}.
            style_callback (function, optional): Styling function that is called for each feature, and should return the feature style. This styling function takes the feature as argument. Defaults to None.
            fill_colors (list, optional): The random colors to use for filling polygons. Defaults to ["black"].
            info_mode (str, optional): Displays the attributes by either on_hover or on_click. Any value other than "on_hover" or "on_click" will be treated as None. Defaults to "on_hover".

        Raises:
            FileNotFoundError: The provided shapefile could not be found.
        """
The provided shapefile could not be found.
The provided shapefile could not be found .
FileNotFoundError
self
in_shp
The input file path to the shapefile.
The input file path to the shapefile .
layer_name
The layer name to be used.. Defaults to "Untitled".
The layer name to be used .. Defaults to " Untitled " .
"Untitled"
style
A dictionary specifying the style to be used. Defaults to {}.
A dictionary specifying the style to be used . Defaults to {} .
{}
hover_style
Hover style dictionary. Defaults to {}.
Hover style dictionary . Defaults to {} .
{}
style_callback
Styling function that is called for each feature, and should return the feature style. This styling function takes the feature as argument. Defaults to None.
Styling function that is called for each feature and should return the feature style . This styling function takes the feature as argument . Defaults to None .
None
fill_colors
The random colors to use for filling polygons. Defaults to ["black"].
The random colors to use for filling polygons . Defaults to [ " black " ] .
["black"]
info_mode
Displays the attributes by either on_hover or on_click. Any value other than "on_hover" or "on_click" will be treated as None. Defaults to "on_hover".
Displays the attributes by either on_hover or on_click . Any value other than " on_hover " or " on_click " will be treated as None . Defaults to " on_hover " .
"on_hover"