About GPS ToolKit.NET Mobile
Introduction
Purchasing GPS ToolKit.NET
Redistributing GPS ToolKit.NET
License Agreement
Support
Getting Started
Getting Started
Setting up the GPS
Basic Concepts
GPS ToolKit Sample Projects
About GPS ToolKit Errors
Reference
GPSToolKit Class
Properties
BaudRate
ExtendedFixData
IsGPSConnected
IsPortOpen
LastPositionUpdateTime
NavigationData
PortName
Protocol
Position
Satellites
Speed
TrueCourse
Methods
AddRoute
AddTrack
AddWaypoint
AutoDetectGPS
Close
GetAvailableSystemPorts
GetGPSInfo
GetRoutes
GetSystemPorts
GetTracks
GetWaypoints
Open
ShutOffGPS
WriteRawBinaryToGPS
WriteRawToGPS
Events
GPSConnected
GPSDisconnected
NavigationUpdate
PositionUpdate
RawDataReceived
SatelliteUpdate
Supporting Classes
Altitude
Angle
Distance
ExtendedFixData
Properties
DGPSRefStationID
EstimatedHorizontalError
EstimatedPositionError
EstimatedVerticalError
FixMode
GeoidHeightAboveWGS84
HDOP
MagneticVariation
NumSatellitesInView
PDOP
TimeSinceLastDGPSUpdate
VDOP
GPSInfo
Latitude
Methods
ToDecimalDegreesString
ToDegreesMinutesString
ToDegreesMinutesSecondsString
Longitude
Methods
ToDecimalDegreesString
ToDegreesMinutesString
ToDegreesMinutesSecondsString
NavData
Properties
ActiveRoute
ArrivedAtDest
CrossTrackError
DestWptName
DestWptPosition
IsValid
MagBearingFromOriginToDest
OriginWptName
TrueBearingFromOriginToDest
TrueBearingToDestWpt
VelocityTowardDestWpt
Position
Methods
BearingFrom
BearingTo
DistanceTo
Route
Properties
Name
Waypoints
Satellite
Speed
Track
Properties
Color
DisplayTrack
Name
TrackPoints
TrackPoint
Waypoint
Collections
RouteCollection
SatelliteCollection
TrackCollection
TrackPointCollection
WaypointCollection

AddRoute Method

Adds a route to the GPS

Syntax

[Visual Basic]
object.AddRoute(Route)

[C#]
object.AddRoute(Route)

[C++]
object->AddRoute(Route)

Parameters

object

An object expression that evaluates to a GPSToolKit object.

Route

A Route object.

Return Value

None

Remarks

  • This method adds a route to the GPS. If a route with the same name exists on the GPS, most GPS units will replace the existing route with the new route.
  • Some GPS units may not support full route names and therefore may modify the supplied route name.
  • This method is only supported when using the Garmin protocol.
  • It is not possible to delete a route programmatically; deleting a route can only be done from the GPS unit. Sometimes, however, adding a route with 0 waypoints and the name of an existing route will "partially" delete the route on the GPS (that is, the route still exists but the GPS will not transfer it during a GetRoutes() call)
  • If GPS memory is full, the route will not be added and this method will return without error.

Errors

If using the NMEA 0183 protocol, this method will return a NotSupportedException exception.

Example

[Visual Basic]
' Create new route
Dim NewRoute As New Route
NewRoute.Name = "My New Route"

' Create waypoints for the route
Dim wpt1, wpt2 As Waypoint
wpt1 = New Waypoint("wpt1", New Position(42.12, -75.41))
wpt2 = New Waypoint("wpt2", New Position(42.11, -75.4))

' Add the waypoints to the new route
NewRoute.Waypoints.Add(wpt1)
NewRoute.Waypoints.Add(wpt2)

' Add the route to the GPS
myGPSToolKit.AddRoute(NewRoute)


[C#]
// Create new route
Route NewRoute = new Route();
NewRoute.Name = "My New Route";

// Create waypoints for the route
Waypoint wpt1, wpt2;
wpt1 = new Waypoint("wpt1", new Position(42.12, -75.41));
wpt2 = new Waypoint("wpt2", new Position(42.11, -75.4));

// Add the waypoints to the new route
NewRoute.Waypoints.Add(wpt1);
NewRoute.Waypoints.Add(wpt2);

// Add the route to the GPS
myGPSToolKit.AddRoute(NewRoute);


[C++]
// Create new route
Route *NewRoute = new Route();
NewRoute->Name = "My New Route";

// Create waypoints for the route
Waypoint *wpt1, *wpt2;
wpt1 = new Waypoint("wpt1", new Position(42.12, -75.41));
wpt2 = new Waypoint("wpt2", new Position(42.11, -75.4));

// Add the waypoints to the new route
NewRoute->Waypoints->Add(wpt1);
NewRoute->Waypoints->Add(wpt2);

// Add the route to the GPS
myGPSToolKit->AddRoute(NewRoute);

See Also

GPSToolKit.GetRoutes method | GPSToolKit.AddWaypoint method | GPSToolKit.AddTrack method | Route class