I'm using the SketchEditor to create a selection UI. This works great except that when users rotate the map, the rectangular envelope that is created by the SketchEditor rotates as well. Is there some way to prevent the SketchEditor shapes from rotating the shapes it draws, when the map rotates?
Solved! Go to Solution.
For those that are interested, this question was about dragging a selection rectangle that's always aligned with the screen, regardless of the rotation of the map.
The suggested solution was to use the AGSGeoViewTouchDelegate methods that deal with drag interactions.
Can you please clarify your question? I don't understand if your question is about the rectangular envelope or just sketch moving along with the map?
SketchEditor is added to the map view, so it sticks to the map while the map rotates. This is intentional since the sketch is usually drawn based on the contents of the map, and we want to maintain that relationship when the map is rotated.
However, the sketch alone can be rotated, irrespective of the map's rotation. The rectangular envelope around the sketch is responsible for it. You can disable that by setting `sketchEditor.editConfiguration.allowRotate = false`.
If you can provide further details, I'd be happy to help you.
It’s about the rectangular envelope. The sketch is turned into a selection as soon as they finish drawing, so the sketch moving with the map isn’t an issue. The problem is that if the map has been rotated, then the envelope will be rotated as well when it is drawn. What I’m hoping for is some way to control whether the envelope is rotated when it is initially drawn.
Thanks for the clarification.
Unfortunately, we do not offer the capability right now for the rectangular envelope to be always upright. We can consider that feature for a future release.
For those that are interested, this question was about dragging a selection rectangle that's always aligned with the screen, regardless of the rotation of the map.
The suggested solution was to use the AGSGeoViewTouchDelegate methods that deal with drag interactions.