geemap/geemap.py
def add_osm_from_geocode(
        self,
        query,
        which_result=None,
        by_osmid=False,
        buffer_dist=None,
        layer_name="Untitled",
        style={},
        hover_style={},
        style_callback=None,
        fill_colors=["black"],
        info_mode="on_hover",
    ):
        """Adds OSM data of place(s) by name or ID to the map.

        Args:
            query (str | dict | list): Query string(s) or structured dict(s) to geocode.
            which_result (int, optional): Which geocoding result to use. if None, auto-select the first (Multi)Polygon or raise an error if OSM doesn't return one. to get the top match regardless of geometry type, set which_result=1. Defaults to None.
            by_osmid (bool, optional): If True, handle query as an OSM ID for lookup rather than text search. Defaults to False.
            buffer_dist (float, optional): Distance to buffer around the place geometry, in meters. Defaults to None.
            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".

        """

        gdf = osm_gdf_from_geocode(
            query, which_result=which_result, by_osmid=by_osmid, buffer_dist=buffer_dist
        )
        geojson = gdf.__geo_interface__

        self.add_geojson(
            geojson,
            layer_name=layer_name,
            style=style,
            hover_style=hover_style,
            style_callback=style_callback,
            fill_colors=fill_colors,
            info_mode=info_mode,
        )
        self.zoom_to_gdf(gdf)
Adds OSM data of place(s) by name or ID to the map.

        Args:
            query (str | dict | list): Query string(s) or structured dict(s) to geocode.
            which_result (int, optional): Which geocoding result to use. if None, auto-select the first (Multi)Polygon or raise an error if OSM doesn't return one. to get the top match regardless of geometry type, set which_result=1. Defaults to None.
            by_osmid (bool, optional): If True, handle query as an OSM ID for lookup rather than text search. Defaults to False.
            buffer_dist (float, optional): Distance to buffer around the place geometry, in meters. Defaults to None.
            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".

        
Adds OSM data of place(s) by name or ID to the map.
Adds OSM data of place ( s ) by name or ID to the map .
def add_osm_from_geocode(
        self,
        query,
        which_result=None,
        by_osmid=False,
        buffer_dist=None,
        layer_name="Untitled",
        style={},
        hover_style={},
        style_callback=None,
        fill_colors=["black"],
        info_mode="on_hover",
    ):
        gdf = osm_gdf_from_geocode(
            query, which_result=which_result, by_osmid=by_osmid, buffer_dist=buffer_dist
        )
        geojson = gdf.__geo_interface__
        self.add_geojson(
            geojson,
            layer_name=layer_name,
            style=style,
            hover_style=hover_style,
            style_callback=style_callback,
            fill_colors=fill_colors,
            info_mode=info_mode,
        )
        self.zoom_to_gdf(gdf)
def add_osm_from_geocode ( self , query , which_result = None , by_osmid = False , buffer_dist = None , layer_name = "Untitled" , style = { } , hover_style = { } , style_callback = None , fill_colors = [ "black" ] , info_mode = "on_hover" , ) : gdf = osm_gdf_from_geocode ( query , which_result = which_result , by_osmid = by_osmid , buffer_dist = buffer_dist ) geojson = gdf . __geo_interface__ self . add_geojson ( geojson , layer_name = layer_name , style = style , hover_style = hover_style , style_callback = style_callback , fill_colors = fill_colors , info_mode = info_mode , ) self . zoom_to_gdf ( gdf )
Adds OSM data of place(s) by name or ID to the map.
Adds OSM data of place ( s ) by name or ID to the map .
"""Adds OSM data of place(s) by name or ID to the map.

        Args:
            query (str | dict | list): Query string(s) or structured dict(s) to geocode.
            which_result (int, optional): Which geocoding result to use. if None, auto-select the first (Multi)Polygon or raise an error if OSM doesn't return one. to get the top match regardless of geometry type, set which_result=1. Defaults to None.
            by_osmid (bool, optional): If True, handle query as an OSM ID for lookup rather than text search. Defaults to False.
            buffer_dist (float, optional): Distance to buffer around the place geometry, in meters. Defaults to None.
            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".

        """
self
query
Query string(s) or structured dict(s) to geocode.
Query string ( s ) or structured dict ( s ) to geocode .
which_result
Which geocoding result to use. if None, auto-select the first (Multi)Polygon or raise an error if OSM doesn't return one. to get the top match regardless of geometry type, set which_result=1. Defaults to None.
Which geocoding result to use . if None auto - select the first ( Multi ) Polygon or raise an error if OSM doesn ' t return one . to get the top match regardless of geometry type set which_result = 1 . Defaults to None .
None
by_osmid
If True, handle query as an OSM ID for lookup rather than text search. Defaults to False.
If True handle query as an OSM ID for lookup rather than text search . Defaults to False .
False
buffer_dist
Distance to buffer around the place geometry, in meters. Defaults to None.
Distance to buffer around the place geometry in meters . Defaults to None .
None
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"