C# 클래스 Rock.Web.UI.Controls.GeoPicker

This control will create a Google map with drawring tools that allows the user to define a single point or a polygon which forms a geo-fence depending on the Rock.Web.UI.Controls.GeoPicker.ManagerDrawingMode.Point. To use on a page or usercontrol: ]]> To set an initial value: gpGeoPoint.SetValue( DbGeography.FromText("POINT(-122.335197 47.646711)") ); To access the value after it's been set use the SelectedValue property: DbGeography point = gpGeoPoint.SelectedValue; If you wish to set an appropriate, initial center point you can use the CenterPoint property.
상속: System.Web.UI.WebControls.CompositeControl, IRockControl
파일 보기 프로젝트 열기: SparkDevNetwork/Rock 1 사용 예제들

Private Properties

프로퍼티 타입 설명
ConvertPointFromWellKnownText string
ConvertPointToWellKnownText string
ConvertPolyFromWellKnownText string

공개 메소드들

메소드 설명
ConvertPolyToWellKnownText ( string latCommaLongPipe ) : string

Convert string from "lat1,long1|lat2,long2|..." to Well Known Text (WKT) http://en.wikipedia.org/wiki/Well-known_text format "POLYGON(( long1 lat1, long2 lat2, ...))". It is expected that the input is a single polygon (not a polygon with an inner polygon). It will also correct the orientation (clockwise-ness) of the points because DbGeography needs them to be in counter-clockwise order.

GeoPicker ( ) : System

Initializes a new instance of the GeoPicker class.

IsClockwisePolygon ( PointF polygon ) : bool

Attempt to determine if the polygon is clockwise or counter-clockwise. Thank you dominoc! http://dominoc925.blogspot.com/2012/03/c-code-to-determine-if-polygon-vertices.html

RenderBaseControl ( System.Web.UI.HtmlTextWriter writer ) : void

Renders the base control.

RenderControl ( System.Web.UI.HtmlTextWriter writer ) : void

Outputs server control content to a provided T:System.Web.UI.HtmlTextWriter object and stores tracing information about the control if tracing is enabled.

SetValue ( System.Data.Entity.Spatial.DbGeography dbGeography ) : void

Sets the value. Necessary to preload the geo fence or geo point.

보호된 메소드들

메소드 설명
CreateChildControls ( ) : void

Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.

OnInit ( EventArgs e ) : void

Raises the E:System.Web.UI.Control.Init event.

RegisterJavaScript ( ) : void

Registers the java script.

btnSelect_Click ( object sender, EventArgs e ) : void

Handles the Click event of the btnSelect control.

비공개 메소드들

메소드 설명
ConvertPointFromWellKnownText ( string wkt ) : string

Convert from WKT format: "POINT (long1 lat1)" to "lat1,long1"

ConvertPointToWellKnownText ( string latCommaLong ) : string

Converts single coordinate set (lat,long) into the Well Known Text (WKT) POINT format. http://en.wikipedia.org/wiki/Well-known_text

ConvertPolyFromWellKnownText ( string wkt ) : string

Convert from WKT format: "POLYGON ((long1 lat1, long2 lat2, ...))" to "lat1,long1|lat2,long2|..."

메소드 상세

ConvertPolyToWellKnownText() 공개 정적인 메소드

Convert string from "lat1,long1|lat2,long2|..." to Well Known Text (WKT) http://en.wikipedia.org/wiki/Well-known_text format "POLYGON(( long1 lat1, long2 lat2, ...))". It is expected that the input is a single polygon (not a polygon with an inner polygon). It will also correct the orientation (clockwise-ness) of the points because DbGeography needs them to be in counter-clockwise order.
public static ConvertPolyToWellKnownText ( string latCommaLongPipe ) : string
latCommaLongPipe string string of "lat1,long1|lat2,long2|..."
리턴 string

CreateChildControls() 보호된 메소드

Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
protected CreateChildControls ( ) : void
리턴 void

GeoPicker() 공개 메소드

Initializes a new instance of the GeoPicker class.
public GeoPicker ( ) : System
리턴 System

IsClockwisePolygon() 공개 정적인 메소드

Attempt to determine if the polygon is clockwise or counter-clockwise. Thank you dominoc! http://dominoc925.blogspot.com/2012/03/c-code-to-determine-if-polygon-vertices.html
public static IsClockwisePolygon ( PointF polygon ) : bool
polygon System.Drawing.PointF
리턴 bool

OnInit() 보호된 메소드

Raises the E:System.Web.UI.Control.Init event.
protected OnInit ( EventArgs e ) : void
e System.EventArgs An object that contains the event data.
리턴 void

RegisterJavaScript() 보호된 메소드

Registers the java script.
protected RegisterJavaScript ( ) : void
리턴 void

RenderBaseControl() 공개 메소드

Renders the base control.
public RenderBaseControl ( System.Web.UI.HtmlTextWriter writer ) : void
writer System.Web.UI.HtmlTextWriter The writer.
리턴 void

RenderControl() 공개 메소드

Outputs server control content to a provided T:System.Web.UI.HtmlTextWriter object and stores tracing information about the control if tracing is enabled.
public RenderControl ( System.Web.UI.HtmlTextWriter writer ) : void
writer System.Web.UI.HtmlTextWriter The object that receives the control content.
리턴 void

SetValue() 공개 메소드

Sets the value. Necessary to preload the geo fence or geo point.
public SetValue ( System.Data.Entity.Spatial.DbGeography dbGeography ) : void
dbGeography System.Data.Entity.Spatial.DbGeography The db geography.
리턴 void

btnSelect_Click() 보호된 메소드

Handles the Click event of the btnSelect control.
protected btnSelect_Click ( object sender, EventArgs e ) : void
sender object The source of the event.
e System.EventArgs The instance containing the event data.
리턴 void