Struct
LocationRect

Represents rectangle given in the geographical units.

Definition

Namespace:Telerik.Windows.Controls.Map

Assembly:Telerik.Windows.Controls.DataVisualization.dll

Syntax:

cs-api-definition
[SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")]
[TypeConverter(typeof(LocationRectConverter))]
public struct LocationRect

Constructors

LocationRect(Location, Location)

Initializes a new instance of the LocationRect struct.

Declaration

cs-api-definition
public LocationRect(Location location1, Location location2)

Parameters

location1

Location

First corner of the rectangle.

location2

Location

Second corner of the rectangle.

LocationRect(double, double, double, double)

Initializes a new instance of the LocationRect struct.

Declaration

cs-api-definition
public LocationRect(double north, double west, double width, double height)

Parameters

north

double

Latitude of the northern side of the rectangle.

west

double

Longitude of the western side of the rectangle.

width

double

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

height

double

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

Properties

Center

Gets geographical center of the rectangle.

Declaration

cs-api-definition
public Location Center { get; }

Property Value

Location

East

Gets the longitude of the eastern side of the rectangle.

Declaration

cs-api-definition
public double East { get; }

Property Value

double

GeoSize

Gets geographical size of the location rectangle in degrees.

Declaration

cs-api-definition
public Size GeoSize { get; }

Property Value

Size

Height

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

Declaration

cs-api-definition
public double Height { get; set; }

Property Value

double

IsEmpty

Gets value which indicates that given geographical rectangle is empty.

Declaration

cs-api-definition
public bool IsEmpty { get; }

Property Value

bool

MapControl

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

Declaration

cs-api-definition
public RadMap MapControl { get; set; }

Property Value

RadMap

North

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

Declaration

cs-api-definition
public double North { get; set; }

Property Value

double

Northeast

Gets location of the northeast corner of the rectangle.

Declaration

cs-api-definition
public Location Northeast { get; }

Property Value

Location

Northwest

Gets location of the northwest corner of the rectangle.

Declaration

cs-api-definition
public Location Northwest { get; }

Property Value

Location

South

Gets the latitude of the southern side of the rectangle.

Declaration

cs-api-definition
public double South { get; }

Property Value

double

Southeast

Gets location of the southeast corner of the rectangle.

Declaration

cs-api-definition
public Location Southeast { get; }

Property Value

Location

Southwest

Gets location of the southwest corner of the rectangle.

Declaration

cs-api-definition
public Location Southwest { get; }

Property Value

Location

UniqueId

Gets unique region ID.

Declaration

cs-api-definition
public int UniqueId { get; }

Property Value

int

ViewCenter

Gets view center of the rectangle.

Declaration

cs-api-definition
public Location ViewCenter { get; }

Property Value

Location

West

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

Declaration

cs-api-definition
public double West { get; set; }

Property Value

double

Width

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

Declaration

cs-api-definition
public double Width { get; set; }

Property Value

double

ZoomLevel

Gets zoom level optimal to show this rectangle.

Declaration

cs-api-definition
public int ZoomLevel { get; }

Property Value

int

Methods

Contains(Location)

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

Declaration

cs-api-definition
public bool Contains(Location location)

Parameters

location

Location

Location to check.

Returns

bool

true if location is inside rectangle. Otherwise false.

Contains(LocationRect)

Detect whether location rectangle contains another one.

Declaration

cs-api-definition
public bool Contains(LocationRect other)

Parameters

other

LocationRect

Location rectangle to check.

Returns

bool

true if this rectangle contains another one.

Equals(LocationRect, LocationRect)

Compares two LocationRect structures for equality.

Declaration

cs-api-definition
public static bool Equals(LocationRect rect1, LocationRect rect2)

Parameters

rect1

LocationRect

The instance of LocationRect to compare.

rect2

LocationRect

The instance of LocationRect to compare.

Returns

bool

true if instances are equal; otherwise, false.

Equals(object)

Compares two LocationRect structures for equality.

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

The instance of LocationRect to compare to this instance.

Returns

bool

true if instances are equal; otherwise, false.

Overrides ValueType.Equals(object)

GetHashCode()

Gets a hash code for this LocationRect structure.

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

A hash code for this LocationRect structure.

Overrides ValueType.GetHashCode()

Intersect(LocationRect)

Detect whether location rectangle intersect with another one.

Declaration

cs-api-definition
public bool Intersect(LocationRect other)

Parameters

other

LocationRect

Location rectangle to check intersection with.

Returns

bool

true if 2 rectangles intersect.

IntersectWithLine(Location, Location)

Detect whether location rectangle intersect with given line.

Declaration

cs-api-definition
public bool IntersectWithLine(Location location1, Location location2)

Parameters

location1

Location

Line point 1.

location2

Location

Line point 2.

Returns

bool

true if line intersect rectangle.

Parse(string)

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

Declaration

cs-api-definition
public static LocationRect Parse(string source)

Parameters

source

string

The String representation of the Location object.

Returns

LocationRect

The equivalent Location structure.

ToString()

Creates a String representation of this LocationRect object.

Declaration

cs-api-definition
public override string ToString()

Returns

string

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

Overrides ValueType.ToString()

ToString(IFormatProvider)

Creates a String representation of this LocationRect object.

Declaration

cs-api-definition
public string ToString(IFormatProvider provider)

Parameters

provider

IFormatProvider

The culture-specific formatting information.

Returns

string

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

Union(LocationRect)

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

Declaration

cs-api-definition
public LocationRect Union(LocationRect other)

Parameters

other

LocationRect

The rectangle to include.

Returns

LocationRect

Operators

operator !=(LocationRect, LocationRect)

Compares two LocationRect structures for inequality.

Declaration

cs-api-definition
public static bool operator !=(LocationRect rect1, LocationRect rect2)

Parameters

rect1

LocationRect

The instance of LocationRect to compare.

rect2

LocationRect

The instance of LocationRect to compare.

Returns

bool

true if instances are equal; otherwise, false.

operator ==(LocationRect, LocationRect)

Compares two LocationRect structures for equality.

Declaration

cs-api-definition
public static bool operator ==(LocationRect rect1, LocationRect rect2)

Parameters

rect1

LocationRect

The instance of LocationRect to compare.

rect2

LocationRect

The instance of LocationRect to compare.

Returns

bool

true if instances are equal; otherwise, false.