onMouseDownMap event with Line shape - Addin Tool

1598
10
09-07-2018 11:36 AM
YoavAbadi
New Contributor II

Hi,

I'm having issuses while developing a new addin - it seems that ALL mouse event handlers (except onMouseMove[Map]), doesn't work / blocked when I draw a line in on the map.

I really need that functionality, since my tool need to ignore certain points on the polyline, indicated by ctrl+left mouse click.

Does anybody knows how can I get thouse events while drawing a line?

Thanks,

Yoav.

P.S: There's a code example:

class DrawLine(object):
    """Implementation for SomeToolExample.drawline (Tool)"""
    def __init__(self):
        self.enabled = False
        self.shape = "Line"

    def onMouseDown(self, x, y, button, shift):
        # This DOESN'T work (blocked?) while a drawing a line
        pass

    def onMouseDownMap(self, x, y, button, shift):
        # This DOESN'T work (blocked?) while a drawing a line
        pass

    def onMouseUp(self, x, y, button, shift):
        # This DOESN'T work (blocked?) while a drawing a line
        pass

    def onMouseUpMap(self, x, y, button, shift):
        # This DOESN'T work (blocked?) while a drawing a line
        pass

    def onMouseMove(self, x, y, button, shift):
        # This is working while a drawing a line
        pass

    def onMouseMoveMap(self, x, y, button, shift):
        # This is working while a drawing a line
        pass

    def onDblClick(self):
        pass

    def onKeyDown(self, keycode, shift):
        # This DOESN'T work (blocked?) while a drawing a line
        pass

    def onKeyUp(self, keycode, shift):
        # This DOESN'T work (blocked?) while a drawing a line
        pass

    def deactivate(self):
        pass

    def onLine(self, line_geometry):
        # Main Logic here, not important for this example
        pass
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
10 Replies
YoavAbadi
New Contributor II

A simple print doesn't work. Of course, I want an array like you said, but the event is blocked by the line drawing (doesn't even print the x, y of onMouseDownMap). That's the issue I'm having.

0 Kudos