Public Member Functions | Properties
Extents Class Reference

Represents a rectangle on the map. More...

List of all members.

Public Member Functions

void GetBounds (out double xMin, out double yMin, out double zMin, out double xMax, out double yMax, out double zMax)
 Gets the bounds of the extents object.
void GetMeasureBounds (out double mMin, out double mMax)
 Gets the minimum and maximum measure bounds for the extents object.
void MoveTo (double x, double y)
 Moves extents so that center point will be at specified coordinates, while width and height will be preserved.
bool PointIsWithin (double x, double y)
 Checks whether a point is within extents.
void SetBounds (double xMin, double yMin, double zMin, double xMax, double yMax, double zMax)
 Sets the bounds for the extents object.
void SetMeasureBounds (double mMin, double mMax)
 Sets the measure bounds of the extents object.
string ToDebugString ()
 Gets serialized contents of the extents for debug purposes.
Shape ToShape ()
 Creates a rectangular polygon matching current extents.

Properties

Point Center [get]
 Gets a center point for the extents.
double mMax [get]
 The maximum measure bound in the exents object. Measure bounds only apply to shapefiles containing measure data.
double mMin [get]
 Gets the minimum measure bound for the extents object. Measure bounds only apply to shapefiles containing measure data.
double xMax [get]
 The maximum x bound for the extents object.
double xMin [get]
 Gets the minimum x bound for the extents object.
double yMax [get]
 The maximum y bound for the extents object.
double yMin [get]
 Gets the minimum y bound for the extents object.
double zMax [get]
 The maximum z bound for the extents object.
double zMin [get]
 Gets the minimum z bound for the extents object.

Detailed Description

Represents a rectangle on the map.

In some cases additional Z and M dimensions can also be specified to denote the altitude of the displayed data for example.
Let's see how to display certain extents on the map.

 double y = 48.7;    // latitude, deg.
 double x = 2.3;     // longitude, deg.
 double span = 0.1;  // deg.

 // extents from 48.5 to 48.9 degrees of north latitude and 
 // from 2.1 to 2.5 degrees of east longitude will be set
 Extents ext = new Extents();
 ext.SetBounds(x - span, y - span, 0.0, x + span, y + span, 0.0);

 // show them on the map
 AxMap axMap;
 if (axMap.MapUnits == tkUnitsOfMeasure.umDecimalDegrees){  
    axMap.Extents = ext;
 }

MapWinGIS doesn't hold instances of Extents class for layers or map, but generates them on each client call. Therefore it's useless to try to change those extents in the way like this:

 AxMap axMap;
 Extents ext = axMap.Extents;
 ext.SetBounds(some_bounds);   // map won't be updated

The following line is needed:

 axMap.Extents = ext; 

In case of data layers, like shapefiles or images, the extents are obtained by calculation, so the only way to alter them is to change the underlying data.

Examples:
EditAttributes.cs, ImageLabels.cs, LabelSelection.cs, RemoveShape.cs, Segmentation.cs, SelectBox.cs, ShapefileToDrawingLayer.cs, ToolTip.cs, TrackCars.cs, and Tracking.cs.

Member Function Documentation

void Extents.GetBounds ( out double  xMin,
out double  yMin,
out double  zMin,
out double  xMax,
out double  yMax,
out double  zMax 
)

Gets the bounds of the extents object.

Parameters:
xMinReturns the minimum x value for the extents object.
yMinReturns the minimum y value for the extents object.
zMinReturns the minimum z value for the extents object.
xMaxReturns the maximum x value for the extents object.
yMaxReturns the maximum y value for the extents object.
zMaxReturns the maximum z value for the extents object.
void Extents.GetMeasureBounds ( out double  mMin,
out double  mMax 
)

Gets the minimum and maximum measure bounds for the extents object.

Measure bounds only apply to shapefiles containing measure data.

Parameters:
mMin
mMax
void Extents.MoveTo ( double  x,
double  y 
)

Moves extents so that center point will be at specified coordinates, while width and height will be preserved.

Parameters:
xX coordinate of new center.
yY coordinate of new center.
New API 4.9.1:
Added in version 4.9.1
bool Extents.PointIsWithin ( double  x,
double  y 
)

Checks whether a point is within extents.

Parameters:
xX coordinate of point
yY coordinate of point
Returns:
True if point is within extents
New API 4.9.1:
Added in version 4.9.1
void Extents.SetBounds ( double  xMin,
double  yMin,
double  zMin,
double  xMax,
double  yMax,
double  zMax 
)

Sets the bounds for the extents object.

Parameters:
xMinThe new minimum x value for the bounds of the extents object.
yMinThe new minimum y value for the bounds of the extents object.
zMinThe new minimum z value for the bounds of the extents object.
xMaxThe new maximum x value for the bounds of the extents object.
yMaxThe new maximum y value for the bounds of the extents object.
zMaxThe new maximum z value for the bounds of the extents object.
Examples:
EditAttributes.cs, RemoveShape.cs, and Tracking.cs.
void Extents.SetMeasureBounds ( double  mMin,
double  mMax 
)

Sets the measure bounds of the extents object.

Measure bounds only apply to shapefiles containing measure data.

Parameters:
mMinThe new minimum measure bound for the extents object.
mMaxThe new maximum measure bound for the extents object.

Gets serialized contents of the extents for debug purposes.

Returns:
Serialized string.
New API 4.9.1:
Added in version 4.9.1
Examples:
CreatePolygonShapefile.cs.

Creates a rectangular polygon matching current extents.

Returns:
New polygon shape.
New API 4.9.1:
Added in version 4.9.1

Property Documentation

Gets a center point for the extents.

New API 4.9.1:
Added in version 4.9.1
double Extents.mMax [get]

The maximum measure bound in the exents object. Measure bounds only apply to shapefiles containing measure data.

double Extents.mMin [get]

Gets the minimum measure bound for the extents object. Measure bounds only apply to shapefiles containing measure data.

double Extents.xMax [get]

The maximum x bound for the extents object.

Examples:
ImageLabels.cs, Segmentation.cs, TrackCars.cs, and Tracking.cs.
double Extents.xMin [get]

Gets the minimum x bound for the extents object.

Examples:
ImageLabels.cs, Segmentation.cs, TrackCars.cs, and Tracking.cs.
double Extents.yMax [get]

The maximum y bound for the extents object.

Examples:
ImageLabels.cs, Segmentation.cs, TrackCars.cs, and Tracking.cs.
double Extents.yMin [get]

Gets the minimum y bound for the extents object.

Examples:
ImageLabels.cs, Segmentation.cs, TrackCars.cs, and Tracking.cs.
double Extents.zMax [get]

The maximum z bound for the extents object.

double Extents.zMin [get]

Gets the minimum z bound for the extents object.

 All Classes Files Functions Enumerations Properties Events