New to Telerik UI for WPFStart a free 30-day trial

Represents rectangle given in the geographical units.

Definition

Namespace:Telerik.Windows.Controls.Map

Assembly:Telerik.Windows.Controls.DataVisualization.dll

Syntax:

C#
[TypeConverter(typeof(LocationRectConverter))]
public struct LocationRect

Constructors

Initializes a new instance of the LocationRect struct.

C#
public LocationRect(double north, double west, double width, double height)
Parameters:northdouble

Latitude of the northern side of the rectangle.

westdouble

Longitude of the western side of the rectangle.

widthdouble

Width of the rectangle given as distance unit used by RadMap control (kilometers or miles).

heightdouble

Height of the rectangle given as distance unit used by RadMap control (kilometers or miles).

Initializes a new instance of the LocationRect struct.

C#
public LocationRect(Location location1, Location location2)
Parameters:location1Location

First corner of the rectangle.

location2Location

Second corner of the rectangle.

Properties

Gets geographical center of the rectangle.

C#
public Location Center { get; }

Gets the longitude of the eastern side of the rectangle.

C#
public double East { get; }

Gets geographical size of the location rectangle in degrees.

C#
public Size GeoSize { get; }

Gets or sets height of the rectangle given as distance unit used by RadMap control (kilometers or miles).

C#
public double Height { get; set; }

Gets value which indicates that given geographical rectangle is empty.

C#
public bool IsEmpty { get; }

Gets or sets the MapControl. All calculated properties (like Northwest or Southeast) of this structure are calculated using setting of this map control.

C#
public RadMap MapControl { get; set; }

Gets or sets the latitude of the northern side of the rectangle.

C#
public double North { get; set; }

Gets location of the northeast corner of the rectangle.

C#
public Location Northeast { get; }

Gets location of the northwest corner of the rectangle.

C#
public Location Northwest { get; }

Gets the latitude of the southern side of the rectangle.

C#
public double South { get; }

Gets location of the southeast corner of the rectangle.

C#
public Location Southeast { get; }

Gets location of the southwest corner of the rectangle.

C#
public Location Southwest { get; }

Gets unique region ID.

C#
public int UniqueId { get; }

Gets view center of the rectangle.

C#
public Location ViewCenter { get; }

Gets or sets longitude of the western side of the rectangle.

C#
public double West { get; set; }

Gets or sets width of the rectangle given as distance unit used by RadMap control (kilometers or miles)..

C#
public double Width { get; set; }

Gets zoom level optimal to show this rectangle.

C#
public int ZoomLevel { get; }

Methods

Indicates whether the rectangle described by the LocationRect contains the specified location.

C#
public bool Contains(Location location)
Parameters:locationLocation

Location to check.

Returns:

bool

true if location is inside rectangle. Otherwise false.

Detect whether location rectangle contains another one.

C#
public bool Contains(LocationRect other)
Parameters:otherLocationRect

Location rectangle to check.

Returns:

bool

true if this rectangle contains another one.

Compares two LocationRect structures for equality.

C#
public static bool Equals(LocationRect rect1, LocationRect rect2)
Parameters:rect1LocationRect

The instance of LocationRect to compare.

rect2LocationRect

The instance of LocationRect to compare.

Returns:

bool

true if instances are equal; otherwise, false.

Compares two LocationRect structures for equality.

C#
public override bool Equals(object obj)
Parameters:objobject

The instance of LocationRect to compare to this instance.

Returns:

bool

true if instances are equal; otherwise, false.

Overrides: ValueType.Equals(object)

Gets a hash code for this LocationRect structure.

C#
public override int GetHashCode()
Returns:

int

A hash code for this LocationRect structure.

Overrides: ValueType.GetHashCode()

Detect whether location rectangle intersect with another one.

C#
public bool Intersect(LocationRect other)
Parameters:otherLocationRect

Location rectangle to check intersection with.

Returns:

bool

true if 2 rectangles intersect.

Detect whether location rectangle intersect with given line.

C#
public bool IntersectWithLine(Location location1, Location location2)
Parameters:location1Location

Line point 1.

location2Location

Line point 2.

Returns:

bool

true if line intersect rectangle.

Converts a String representation of a rectangle into the equivalent LocationRect object.

C#
public static LocationRect Parse(string source)
Parameters:sourcestring

The String representation of the Location object.

Returns:

LocationRect

The equivalent Location structure.

Creates a String representation of this LocationRect object.

C#
public override string ToString()
Returns:

string

A String containing the Latitude and Longitude values of this LocationRect object.

Overrides: ValueType.ToString()

Creates a String representation of this LocationRect object.

C#
public string ToString(IFormatProvider provider)
Parameters:providerIFormatProvider

The culture-specific formatting information.

Returns:

string

A String containing the Latitude and Longitude values of this LocationRect object.

Expands the current rectangle exactly enough to contain the specified rectangle.

C#
public LocationRect Union(LocationRect other)
Parameters:otherLocationRect

The rectangle to include.

Returns:

LocationRect

Operators

Compares two LocationRect structures for inequality.

C#
public static bool operator !=(LocationRect rect1, LocationRect rect2)
Parameters:rect1LocationRect

The instance of LocationRect to compare.

rect2LocationRect

The instance of LocationRect to compare.

Returns:

bool

true if instances are equal; otherwise, false.

Compares two LocationRect structures for equality.

C#
public static bool operator ==(LocationRect rect1, LocationRect rect2)
Parameters:rect1LocationRect

The instance of LocationRect to compare.

rect2LocationRect

The instance of LocationRect to compare.

Returns:

bool

true if instances are equal; otherwise, false.