When I hold down the shift key and drag on the map, the following effect will occur. I want to have the same effect when holding down the ctrl key. Then I get a geometry or an extent. Is there a convenient way to achieve this?
thank you for your replay
This is possible, but whether or not it would be considered convenient could go either way. There's two parts to this:1 is drawing the geometry, and 2 is capturing whether the Ctrl key is down or not when it's drawn. For the geometry, I would recommend using the SketchViewModel module. To capture whether the Ctrl key is down or not, you would use the pointer-down and pointer-up events of the MapView. The argument passed to those event handlers will have a property called "native" that provides information about the click. That "native" object has a Boolean property named "ctrlKey" So, when using the SketchView model to draw a rectangle for example, you would capture the state of the ctrlKey property at the beginning and end of the sketch, and respond in your application accordingly if it was true in both cases.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.