I'm trying to update a polygon-point location using a Map.MouseMove handler but the shape on the map is displayed incorrectly, as if the polygon bounds are not updated. If I position the updated point within the bounds of the existing polygon, all the points are rendered correctly. Changing the zoom level also corrects the problem, until the mouse is moved enough again.
I've attached screenshots:
RadMapPolygonA.png shows the initial, correct state, with the red dot showing the MouseMove position which is supposed to update the location of the point beneath it.
RadMapPolygonB.png shows what happens if you update the location property of the polygon point outside the bounds of the existing polygon.
RadMapPolygonC.png shows the correctly rendered polygon after I changed the zoom level and reset it.
I've attached screenshots:
RadMapPolygonA.png shows the initial, correct state, with the red dot showing the MouseMove position which is supposed to update the location of the point beneath it.
RadMapPolygonB.png shows what happens if you update the location property of the polygon point outside the bounds of the existing polygon.
RadMapPolygonC.png shows the correctly rendered polygon after I changed the zoom level and reset it.
void
RadMapMouseMove(
object
sender, MouseEventArgs e)
{
if
(!vm.DrawingShape || vm.CurrentShape ==
null
)
return
;
if
(vm.CurrentShape.LocationWrappers.Count < 2)
return
;
var locationWrapper = vm.CurrentShape.LocationWrappers[vm.CurrentShape.LocationWrappers.Count - 1];
var location = Location.GetCoordinates(RadMap, e.GetPosition(RadMap));
locationWrapper.Location = location;
// updates databound LocationCollection
}