Click or drag to resize

RectangleFence Class

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
A rectangular GeoFence.
Inheritance Hierarchy
SystemObject
  Telogis.GeoBase.GeoFenceRectangleFence

Namespace:  Telogis.GeoBase.GeoFence
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public class RectangleFence : IMapRenderer, 
	IGeoFence

The RectangleFence type exposes the following members.

Constructors
  NameDescription
Public methodRectangleFence
Initializes a new instance of the RectangleFence class
Top
Properties
  NameDescription
Public propertyBoundingBox
Gets a copy of the BoundingBox that represents this GeoFence.
Public propertyRenderBrush
Brush used to fill the GeoFence, or null for no fill.
Public propertyRenderPen
Pen used to draw the border around the GeoFence, or null for no border.
Public propertyRequiredRendermodes
Gets the RenderMode required by this RectangleFence.
Top
Methods
  NameDescription
Public methodContains
Check whether the given LatLon lies within the borders of this GeoFence.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodRender
Render this GeoFence on the specified IMap.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldBox
The BoundingBox representing the border of this GeoFence.
Top
Remarks

Related articles: Geofences Concept.

Examples
C#
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.

See Also