geemap/geemap.py
def add_marker_cluster(self, event="click", add_marker=True):
        """Captures user inputs and add markers to the map.

        Args:
            event (str, optional): [description]. Defaults to 'click'.
            add_marker (bool, optional): If True, add markers to the map. Defaults to True.

        Returns:
            object: a marker cluster.
        """
        coordinates = []
        markers = []
        marker_cluster = ipyleaflet.MarkerCluster(name="Marker Cluster")
        self.last_click = []
        self.all_clicks = []
        if add_marker:
            self.add_layer(marker_cluster)

        def handle_interaction(**kwargs):
            latlon = kwargs.get("coordinates")

            if event == "click" and kwargs.get("type") == "click":
                coordinates.append(latlon)
                self.last_click = latlon
                self.all_clicks = coordinates
                if add_marker:
                    markers.append(ipyleaflet.Marker(location=latlon))
                    marker_cluster.markers = markers
            elif kwargs.get("type") == "mousemove":
                pass

        # cursor style: https://www.w3schools.com/cssref/pr_class_cursor.asp
        self.default_style = {"cursor": "crosshair"}
        self.on_interaction(handle_interaction)
Captures user inputs and add markers to the map.

        Args:
            event (str, optional): [description]. Defaults to 'click'.
            add_marker (bool, optional): If True, add markers to the map. Defaults to True.

        Returns:
            object: a marker cluster.
        
Captures user inputs and add markers to the map.
Captures user inputs and add markers to the map .
def add_marker_cluster(self, event="click", add_marker=True):
        coordinates = []
        markers = []
        marker_cluster = ipyleaflet.MarkerCluster(name="Marker Cluster")
        self.last_click = []
        self.all_clicks = []
        if add_marker:
            self.add_layer(marker_cluster)
        def handle_interaction(**kwargs):
            latlon = kwargs.get("coordinates")
            if event == "click" and kwargs.get("type") == "click":
                coordinates.append(latlon)
                self.last_click = latlon
                self.all_clicks = coordinates
                if add_marker:
                    markers.append(ipyleaflet.Marker(location=latlon))
                    marker_cluster.markers = markers
            elif kwargs.get("type") == "mousemove":
                pass
        self.default_style = {"cursor": "crosshair"}
        self.on_interaction(handle_interaction)
def add_marker_cluster ( self , event = "click" , add_marker = True ) : coordinates = [ ] markers = [ ] marker_cluster = ipyleaflet . MarkerCluster ( name = "Marker Cluster" ) self . last_click = [ ] self . all_clicks = [ ] if add_marker : self . add_layer ( marker_cluster ) def handle_interaction ( ** kwargs ) : latlon = kwargs . get ( "coordinates" ) if event == "click" and kwargs . get ( "type" ) == "click" : coordinates . append ( latlon ) self . last_click = latlon self . all_clicks = coordinates if add_marker : markers . append ( ipyleaflet . Marker ( location = latlon ) ) marker_cluster . markers = markers elif kwargs . get ( "type" ) == "mousemove" : pass self . default_style = { "cursor" : "crosshair" } self . on_interaction ( handle_interaction )
Captures user inputs and add markers to the map.
Captures user inputs and add markers to the map .
"""Captures user inputs and add markers to the map.

        Args:
            event (str, optional): [description]. Defaults to 'click'.
            add_marker (bool, optional): If True, add markers to the map. Defaults to True.

        Returns:
            object: a marker cluster.
        """ # cursor style: https://www.w3schools.com/cssref/pr_class_cursor.asp

a marker cluster.
a marker cluster .
object
self
event
[description]. Defaults to 'click'.
[ description ] . Defaults to ' click ' .
'click'
add_marker
If True, add markers to the map. Defaults to True.
If True add markers to the map . Defaults to True .
True