private void StopDrag() { DragImage.Dispose(); StaticToolsImage.Dispose(); Dragging = false; var point = new Point((MapControl.ClientSize.Width / 2 + (DragStartPoint.X - DragEndPoint.X)), (MapControl.ClientSize.Height / 2 + (DragStartPoint.Y - DragEndPoint.Y))); Map.Center = Map.ImageToWorld(point); MapControl.Cursor = Cursors.Default; MapControl.Refresh(); }
public override void OnMouseUp(ICoordinate worldPosition, MouseEventArgs e) { if (!Dragging) { return; } DragImage.Dispose(); StaticToolsImage.Dispose(); Dragging = false; Point point = new Point((MapControl.ClientSize.Width / 2 + (DragStartPoint.X - DragEndPoint.X)), (MapControl.ClientSize.Height / 2 + (DragStartPoint.Y - DragEndPoint.Y))); Map.Center = Map.ImageToWorld(point); MapControl.Cursor = Cursors.Default; MapControl.Refresh(); }