C# Class WpfMapControl.MapControl

Interaction logic for UserControl1.xaml
Inheritance: System.Windows.Controls.UserControl
Show file Open project: gkrsu/maparound.core

Private Properties

Property Type Description
AnimatedPan void
BeginMapDrawing Thread
CalcAnimationRectangles void
ConvertBitmap System.Windows.Media.Imaging.BitmapSource
DrawAnimated void
DrawDragging void
DrawGeneral void
FitViewBoxSize void
GetAvgMouseSpeed ICoordinate
GetMouseSpeed ICoordinate
MapDrawWorker void
MapViewBoxToClientRectangle System.Windows.Rect
MeasureMouseMovementParameters void
OnMouseLeftButtonDown void
OnMouseLeftButtonUp void
OnMouseMove void
OnMouseWheel void
OnSizeChanged void
Play void
PlayFade void
PrepareForSelect ICoordinate
SetViewBoxWithAnimation void
WheelTimerTick void
WhetherViewBoxChanged bool

Public Methods

Method Description
ChangeZoom ( int deltaPercent, double mouseX, double mouseY ) : void

Changes a zoom.

ClientToMap ( Point point ) : ICoordinate

Transforms screen coordinates to map coordinates.

GetFeatureAtPosition ( Point position ) : Feature

Finds a topmost feature of the map at specified point.

GetFeaturesAtPosition ( Point position ) : IList

Finds features of the map at specified point.

MapControl ( ) : System

Initializes a new instance of MapAround.UI.WPF.MapControl

MapToClient ( ICoordinate point ) : Point

Transforms map coordinates to screen coordinates.

Pan ( double horizontalShift, double verticalShift ) : void

Pans a map.

Pan ( double horizontalShift, double verticalShift, bool forceRedraw, bool playAnimation ) : void

Pans a map.

RedrawMap ( ) : void

Redraws a map image.

SetViewBox ( BoundingRectangle viewBox ) : void

Sets a new visible area of map.

SetViewBox ( BoundingRectangle viewBox, bool forceRedraw, bool forceSizeFitting, bool playAnimation ) : void

Sets a new visible area of map.

ZoomIn ( ) : void

Zooms in.

ZoomIn ( Point p ) : void

Zooms in.

ZoomOut ( ) : void

Zooms out.

ZoomOut ( Point p ) : void

Zooms out.

Protected Methods

Method Description
OnRender ( System.Windows.Media.DrawingContext drawingContext ) : void

Private Methods

Method Description
AnimatedPan ( double horizontalShift, double verticalShift ) : void

BeginMapDrawing ( ) : Thread

Start drawing map

CalcAnimationRectangles ( BoundingRectangle oldViewBox, BoundingRectangle viewBox, Rect &begin, Rect &end ) : void

Calculation of the animation Rectangle

ConvertBitmap ( System gdiPlusBitmap ) : System.Windows.Media.Imaging.BitmapSource

Converter Bitmap в BitmapSource

DrawAnimated ( System.Windows.Media.DrawingContext dc ) : void
DrawDragging ( System.Windows.Media.DrawingContext dc ) : void
DrawGeneral ( System.Windows.Media.DrawingContext dc ) : void

The main mode is called when rendering при _animated = false;

FitViewBoxSize ( BoundingRectangle viewBox ) : void

Fit Size ViewBox

GetAvgMouseSpeed ( ) : ICoordinate
GetMouseSpeed ( System.DateTime satrtTime, System.DateTime endtime, Point startPoint, Point endPoint ) : ICoordinate
MapDrawWorker ( ) : void

Render Map

MapViewBoxToClientRectangle ( BoundingRectangle r ) : Rect

Translated from the card in the client rectangle ViewBox

MeasureMouseMovementParameters ( Point p ) : void

Measurement of the parameters you move the mouse

OnMouseLeftButtonDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
OnMouseLeftButtonUp ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
OnMouseMove ( object sender, System.Windows.Input.MouseEventArgs e ) : void
OnMouseWheel ( object sender, System.Windows.Input.MouseWheelEventArgs e ) : void
OnSizeChanged ( object sender, EventArgs e ) : void
Play ( Rect startRectangle, Rect endRectangle ) : void

Reproduction shift Rectangle

PlayFade ( ) : void

Playing a manifestation of the effect of image

PrepareForSelect ( Point position ) : ICoordinate
SetViewBoxWithAnimation ( Rect begin, Rect end ) : void

Set ViewBox with animation

WheelTimerTick ( object sender, EventArgs e ) : void
WhetherViewBoxChanged ( BoundingRectangle newViewBox ) : bool

Has been modified ViewBox

Method Details

ChangeZoom() public method

Changes a zoom.
public ChangeZoom ( int deltaPercent, double mouseX, double mouseY ) : void
deltaPercent int A value (percents) by which a zoom change
mouseX double An X coordinate of the mouse
mouseY double A Y coordinate of the mouse
return void

ClientToMap() public method

Transforms screen coordinates to map coordinates.
public ClientToMap ( Point point ) : ICoordinate
point Point A point on the screen
return ICoordinate

GetFeatureAtPosition() public method

Finds a topmost feature of the map at specified point.
public GetFeatureAtPosition ( Point position ) : Feature
position Point A point at which to find feature
return Feature

GetFeaturesAtPosition() public method

Finds features of the map at specified point.
public GetFeaturesAtPosition ( Point position ) : IList
position Point A point at which to find feature
return IList

MapControl() public method

Initializes a new instance of MapAround.UI.WPF.MapControl
public MapControl ( ) : System
return System

MapToClient() public method

Transforms map coordinates to screen coordinates.
public MapToClient ( ICoordinate point ) : Point
point ICoordinate A point on the map
return Point

OnRender() protected method

protected OnRender ( System.Windows.Media.DrawingContext drawingContext ) : void
drawingContext System.Windows.Media.DrawingContext
return void

Pan() public method

Pans a map.
public Pan ( double horizontalShift, double verticalShift ) : void
horizontalShift double Horizontal shift in pixels
verticalShift double Vertical shift in pixels
return void

Pan() public method

Pans a map.
public Pan ( double horizontalShift, double verticalShift, bool forceRedraw, bool playAnimation ) : void
horizontalShift double Horizontal shift in pixels
verticalShift double Horizontal shift in pixels
forceRedraw bool A value indicating whether a map image should be rendered /// even if the viewing area is unchanged
playAnimation bool A value indicating whether an animation effect is played
return void

RedrawMap() public method

Redraws a map image.
public RedrawMap ( ) : void
return void

SetViewBox() public method

Sets a new visible area of map.
public SetViewBox ( BoundingRectangle viewBox ) : void
viewBox BoundingRectangle Bounding rectangle defining an area of view
return void

SetViewBox() public method

Sets a new visible area of map.
public SetViewBox ( BoundingRectangle viewBox, bool forceRedraw, bool forceSizeFitting, bool playAnimation ) : void
viewBox BoundingRectangle Bounding rectangle defining an area of view
forceRedraw bool A value indicating whether a map image should be rendered /// even if the viewing area is unchanged
forceSizeFitting bool A value indicating whether a view box sizes should be corrected /// to fit map control sizes
playAnimation bool A value indicating whether an animation effect is played
return void

ZoomIn() public method

Zooms in.
public ZoomIn ( ) : void
return void

ZoomIn() public method

Zooms in.
public ZoomIn ( Point p ) : void
p Point A mouse position
return void

ZoomOut() public method

Zooms out.
public ZoomOut ( ) : void
return void

ZoomOut() public method

Zooms out.
public ZoomOut ( Point p ) : void
p Point A mouse position
return void