RectangleFence Class |
Namespace: Telogis.GeoBase.GeoFence
The RectangleFence type exposes the following members.
Name | Description | |
---|---|---|
RectangleFence | Initializes a new instance of the RectangleFence class |
Name | Description | |
---|---|---|
BoundingBox |
Gets a copy of the BoundingBox that represents this GeoFence.
| |
RenderBrush | Brush used to fill the GeoFence, or null for no fill.
| |
RenderPen | Pen used to draw the border around the GeoFence, or null for no border.
| |
RequiredRendermodes |
Gets the RenderMode required by this RectangleFence.
|
Name | Description | |
---|---|---|
Contains |
Check whether the given LatLon lies within the borders
of this GeoFence.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Render |
Render this GeoFence on the specified IMap.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Box |
The BoundingBox representing the border of this GeoFence.
|
Related articles: Geofences Concept.
RectangleFence rf = new RectangleFence(); // to set the boundaries of the rectangle fence, // we need to create a bounding box // and assign it to the Box field BoundingBox bb = new BoundingBox(); bb.Add(new LatLon(33.581, -117.726)); bb.Add(new LatLon(32.588, -117.728)); rf.Box = bb; // Note: to edit the dimensions of the RectangleFence, // use the methods of rf.Box. (e.g. by calling AddPoint or InflateBy). // Now draw the RectangleFence on our map myMap.Renderer = rf;
The example above uses RectangleBox.Box to set the dimensions of the RectangleFence. You can use RectangleBox.Box to manipulate the RectangleFence. Do not try to manipulate the RectangleFence using its BoundingBox property. RectangleBox.BoundingBox returns a copy of the RectangleFence, so changing its property has no effect on the RectangleFence.
The same geofence can also be created using only XAML code. See PolygonFence for an example.