Click or drag to resize

VehicleMarker Class

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Used to display a vehicle's location on a map.
Inheritance Hierarchy
SystemObject
  Telogis.GeoBase.NavigationVehicleMarker

Namespace:  Telogis.GeoBase.Navigation
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public class VehicleMarker : IMapRenderer

The VehicleMarker type exposes the following members.

Constructors
  NameDescription
Public methodVehicleMarker
Create a new VehicleMarker object, using the specified Navigator object to provide location information.
Top
Properties
  NameDescription
Public propertyCircleColor
The color of the circle drawn around the arrow. Blue by default.
Public propertyCode exampleCircleDashPattern
The length of the dashes and spaces, in pixels. {5, 5} by default.
Public propertyCircleDashStyle
The style of the circle drawn around the arrow. Dashed by default.
Public propertyColor
Gets or sets the color (ARGB) used to draw the vehicle marker.
Public propertyDrawActual
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.
Public propertyDrawOffCourseMarker
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.
Public propertyNavigator
Gets or sets the Telogis.GeoBase.Navigation.Navigator object associated with this marker.
Public propertyOffCourseColor
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.
Public propertyOffCourseThreshold
Gets or sets the distance (in pixels) the vehicle marker is allowed to deviate before drawing the off-course marker. Defaults to 35px.
Public propertyRequiredRendermodes
Gets the RenderMode required by this VehicleMarker.
Public propertySize
Gets or sets the size of the vehicle marker (in pixels). Defaults to 20px.
Top
Methods
  NameDescription
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
Renders the VehicleMarker on a given graphics output with a given context. (Desktop version).
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

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.

Examples
C#
...
       // 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();
   }
See Also