Route Alert Geometry
Describes the geometry of a RouteAlert that has a length.
Use LineString.fromPolyline with DirectionsRoute.geometry and the precision argument that was used when requesting the route (RouteOptions.Builder.geometries) to decode the route. When decoded, you can find the geometry of the alert using the startGeometryIndex
and endGeometryIndex
values as arguments for LineString.coordinates. This sublist of coordinates can be used to create and draw the geometry with LineString.fromLngLats.
Also see RouteAlertGeometry.toLineString extension which automates above.
Parameters
length of the alert.
point where the alert starts.
index of a point in the route geometry where the alert starts.
point where the alert ends.
index of a point in the route geometry where the alert ends.