Hi,
I have a question, I use SketchViewModel to draw the shape on map, I want to keep the shape located in center (not moving) when the map is moving by pan or drag; how can I implement it?
Thanks in advance.
Solved! Go to Solution.
Get the extent of the map.
Pick a corner of the map and store it in a variable (startingPoint).
Listen for the map to move. When it does, get the new extent.
Check the change from startingPoint to the new extent. (Ex. +3 degrees lat, -2 long)
Get the geometry of the shape you drew.
Loop through each point on the shape and adjust the coordinates by the same amount the startingPoint shifted.
Get the extent of the map.
Pick a corner of the map and store it in a variable (startingPoint).
Listen for the map to move. When it does, get the new extent.
Check the change from startingPoint to the new extent. (Ex. +3 degrees lat, -2 long)
Get the geometry of the shape you drew.
Loop through each point on the shape and adjust the coordinates by the same amount the startingPoint shifted.
Thanks! Good solution.