Skip to main content

Waypoint

Namespace: Wisej.Web.Ext.GoogleMaps

Assembly: Wisej.Web.Ext.GoogleMaps (4.1.0.0)

A waypoint alters a route by routing it through the specified location.

public class Waypoint

Waypoints are passed to the AddRoute overloads of GoogleMap that accept a Waypoint array. Specify either Location or Address: when Location is set, Address is ignored. See directions#DirectionsWaypoint.

Example:

Routing through a location and an address:

var waypoints = new[]
{
new Waypoint(new LatLng { Lat = 43.7696, Lng = 11.2558 }, true),
new Waypoint("Bologna, Italy", false)
};
this.googleMap1.AddRoute("Rome, Italy", "Milan, Italy", TravelMode.Driving, UnitSystem.Metric, waypoints);

Constructors​

Instance member Waypoint()​

Initializes a new instance of the Waypoint class.

Instance member Waypoint(location, stopover)​

Initializes a new instance of the Waypoint class using a geographical location.

NameTypeDescription
locationLatLngThe LatLng location of the waypoint.
stopoverBooleanTrue if the waypoint is a stop on the route, which splits the route into two legs.

Throws:

Instance member Waypoint(address, stopover)​

Initializes a new instance of the Waypoint class using an address.

NameTypeDescription
addressStringThe address of the waypoint, geocoded by the Google Directions service.
stopoverBooleanTrue if the waypoint is a stop on the route, which splits the route into two legs.

Throws:

Properties​

Instance member Address​

String: Returns or sets the address of the waypoint.

Use this property when not providing a Location, otherwise it's ignored. The address is geocoded by the Google Directions service when the route is calculated.

Throws:

Instance member Location​

LatLng: Returns or sets the location of the waypoint, as a LatLng.

When set, it takes precedence over Address.

Throws:

Instance member Stopover​

Boolean: Returns or sets whether the waypoint is a stop on the route, which has the effect of splitting the route into two legs.