Select product

Show on map

Run the cell below to show selected product boundary on map.


In [97]:
from ipyleaflet import (
    Map,
    Marker,
    TileLayer, ImageOverlay,
    Polyline, Polygon, Rectangle, Circle, CircleMarker,
    GeoJSON,
    DrawControl
)

dc = DrawControl(circle={},rectangle={},polyline={},polygon={}
                ,marker={'shapeOptions':{'color':'#5300FF'}},edit=False)

punkty=[]

def handle_draw(self, action, geo_json):
    global punkty
    print(action)
    if action=='created':
        punkty.append(geo_json['geometry']['coordinates'])
    elif action=='deleted':
        punkty.remove(geo_json['geometry']['coordinates'])        

    print(punkty)
    
    
    
    
    

dc.on_draw(handle_draw)

m=Map(zoom=1)
m.add_control(dc)
m



In [ ]: