AnsweredAssumed Answered

How to freeze map while dragging a graphic?

Question asked by paul.haakma on Jul 10, 2015
Latest reply on Jul 21, 2015 by paul.haakma

Hi All


I'm looking for a way to click on a graphic/icon and drag it around the screen. I have been successful with the following method:


Currently, the code fires inside the onPressAndHold handler and checks to see if a graphic is under the mouseclick/point touched, if yes then it grabs the id of that graphic, and uses in in the onPositionChanged handler to bind the graphic's x,y to the mouse x,y and therefore successfully moves the graphic around until the mouse is released.


My issue is that the onPressAndHold takes a bit long to fire for my liking - my users would be doing this a lot and I think that waiting that extra second each time would soon get annoying.


the onPressAndHold seems to automatically freeze the map while you move the mouse around, but I couldn't find any property of the Map object that explicitly locks or freezes the panning - if there was one then I could use it inside the onPressed handler to temporarily disable the map panning.


Does anyone have any ideas on how I might achieve this using the onPressed instead of onPressAndHold?