VehicleMarker Class |
Namespace: Telogis.GeoBase.Navigation
The VehicleMarker type exposes the following members.
Name | Description | |
---|---|---|
VehicleMarker |
Create a new VehicleMarker object, using the specified Navigator object
to provide location information.
|
Name | Description | |
---|---|---|
CircleColor |
The color of the circle drawn around the arrow. Blue by default.
| |
CircleDashPattern |
The length of the dashes and spaces, in pixels. {5, 5} by default.
| |
CircleDashStyle |
The style of the circle drawn around the arrow. Dashed by default.
| |
Color |
Gets or sets the color (ARGB) used to draw the vehicle marker.
| |
DrawActual |
Gets or sets whether to draw the vehicle's actual or estimated position. If true the actual
position is drawn. If false the estimated position is drawn.
| |
DrawOffCourseMarker |
Whether to draw the off-course marker if the vehicle deviates from the route. If set
to false then the only time the off-course marker will be displayed is if there is not
a GPS fix. Defaults to true. Only valid if DrawActual is true.
| |
Navigator |
Gets or sets the Telogis.GeoBase.Navigation.Navigator
object associated with this marker.
| |
OffCourseColor |
Gets or sets the color (ARGB) used to draw the vehicle marker when the vehicle is
either off-course or there is no GPS fix.
| |
OffCourseThreshold |
Gets or sets the distance (in pixels) the vehicle marker is allowed to deviate before
drawing the off-course marker. Defaults to 35px.
| |
RequiredRendermodes |
Gets the RenderMode required by this VehicleMarker.
| |
Size |
Gets or sets the size of the vehicle marker (in pixels). Defaults to 20px.
|
Name | Description | |
---|---|---|
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 |
Renders the VehicleMarker on a given graphics output with a given context. (Desktop version).
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
The VehicleMarker object uses a Navigator object to determine the location of the vehicle. The VehicleMarker object will not redraw its position automatically. It is your responsibility to update the position of the VehicleMarker object by forcing a redraw (typically by invalidating the MapCtrl that the VehicleMarker object is drawn on). You may wish to do this by attaching to the Update event, or by using a Timer object.
A red arrow is drawn when the vehicle is on-course, this color can be changed by modifying the Color property. When the vehicle deviates off-course a gray arrow will be drawn instead.
... // a Navigator object requires an IGps member, // and a VehicleMarker object requires a Navigator. // this means that you'll need a Navigator and some // form of GPS to use a VehicleMarker object... myNavigator = new Navigator(myGps); myVehicleMarker = new VehicleMarker(myNavigator); // draw the VehicleMarker object on the map. Use a // RendererList object to draw multiple objects on // the same map myMapCtrl.Renderer = myVehicleMarker; // use a Timer object to redraw the location of the // VehicleMarker object once a second. Timer myTimer = new Timer(); myTimer.Interval = 1000; myTimer.Tick += new EventHandler(myTimer_Tick); myTimer.Start(); ... void myTimer_Tick (object sender, EventArgs e) { // invalidating a map causes all the objects on the map // to be redrawn. Redrawing a VehicleMarker object // will cause the VehicleMarker object to update its // location. myMapCtrl.Invalidate(); }