How to use the ipyleaflet.Circle function in ipyleaflet

To help you get started, we’ve selected a few ipyleaflet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sassoftware / python-esppy / esppy / espapi / visuals.py View on Github external
data = o["datasource"].getData()

        for key,value in data.items():
            lat = value[o["lat"]]
            lon = value[o["lon"]]

            radius = 50

            if "radius" in o:
                radius = o["radius"]
            elif "radius_field" in o:
                num = float(value[o["radius_field"]])
                radius = int(num)

            circle = maps.Circle(location=(lat,lon),radius=radius)

            borderWidth = self.getOpt("circle_border_width",2)
            circle.weight = borderWidth

            if borderWidth > 0:
                circle.stroke = True
                circle.color = self.getOpt("circle_border_color","black")
            else:
                circle.stroke = False

            circle.fill_color = self.getOpt("circle_fill_color","white")
            circle.fill_opacity = self.getOpt("circle_fill_opacity",.2)

            if "text" in o:
                text = value[o["text"]]
                circle.popup = widgets.HTML(value=text)