SHARE
TWEET

Python ArcGIS click map and get x,y

furas Jul 18th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top