Obtaining XY coordinate when clicking on the map

11-09-2020 10:50 PM
New Contributor

When I click on the map, I want to get the coordinates, but I get strange coordinates. I work in Arcglobe, and I need latitude and longitude, and instead of them strange values, for example, I got the values long 447 and lat 247, but these are not coordinates of latitude and longitude.

class ToolClass2(object):    """Implementation for coord_addin.tool (Tool)"""    def __init__(self):        self.enabled = True        self.shape = "NONE" # Can set to "Line", "Circle" or "Rectangle" for interactive shape drawing and to activate the onLine/Polygon/Circle event sinks.    def onMouseDown(self, x, y, button, shift):        #pythonaddins.MessageBox("Long" + " " + str(x) + '\n'+ "Lat"+ " " + str(y), 'Coordinates', 0)         pass    def onMouseDownMap(self, x, y, button, shift):        pythonaddins.MessageBox("Long" + " " + str(x) + '\n'+ "Lat"+ " " + str(y), 'Coordinates', 0)        pass    def onMouseUp(self, x, y, button, shift):        pass    def onMouseUpMap(self, x, y, button, shift):        pass    def onMouseMove(self, x, y, button, shift):        pass    def onMouseMoveMap(self, x, y, button, shift):        pass    def onDblClick(self):        pass    def onKeyDown(self, keycode, shift):        pass    def onKeyUp(self, keycode, shift):        pass    def deactivate(self):        pass    def onCircle(self, circle_geometry):        pass    def onLine(self, line_geometry):        pass    def onRectangle(self, rectangle_geometry):        pass
0 Kudos
0 Replies