Advertisement
furas

Python ArcGIS click map and get x,y

Jul 18th, 2018
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. #
  2. # run in Jupyter Notebook or Jupyter Lab
  3. #
  4.  
  5. from arcgis.gis import GIS
  6. import ipywidgets as widgets
  7.  
  8. my_gis = GIS()
  9. my_map = my_gis.map()
  10.  
  11. label = widgets.Label(value="???")
  12. display(label)
  13.  
  14. def test_click(*args):
  15.     print(args)
  16.     print(args[1]['x'], args[1]['y'])
  17.     label.value = "x: {} y: {}".format(args[1]['x'], args[1]['y'])
  18.    
  19. my_map.on_click(test_click)
  20.  
  21. my_map
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement