Class RouteStep
java.lang.Object
com.codename1.maps.routing.RouteStep
One maneuver of a RouteLeg -- "turn left onto Elm Street and continue for
300 m" -- together with the piece of road geometry it covers.
Instances are immutable and are produced by a RouteService; applications
read them to build a turn-by-turn list beside the map.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleThe length of this step in meters.doubleThe estimated time for this step in seconds.A human readable description of the maneuver, for example"Turn left onto Elm Street".The unmodifiableLatLnggeometry travelled by this step, useful to highlight the upcoming maneuver on the map.The name of the road travelled during this step; empty when unnamed.getStart()Where the maneuver takes place, ornullwhen the backend omits it.toString()Returns a string representation of the object.
-
Constructor Details
-
RouteStep
public RouteStep(String instruction, String roadName, double distanceMeters, double durationSeconds, LatLng start, List points) Creates a step. Called by
RouteServiceimplementations.Parameters
-
instruction: a human readable maneuver description -
roadName: the road this step travels along, possibly empty -
distanceMeters: the length of the step in meters -
durationSeconds: the estimated time for the step in seconds -
start: where the maneuver happens -
points: theLatLnggeometry of the step, defensively copied
-
-
-
Method Details
-
getInstruction
A human readable description of the maneuver, for example"Turn left onto Elm Street". Nevernull, but may be empty when the backend supplies no phrasing. -
getRoadName
The name of the road travelled during this step; empty when unnamed. -
getDistanceMeters
public double getDistanceMeters()The length of this step in meters. -
getDurationSeconds
public double getDurationSeconds()The estimated time for this step in seconds. -
getStart
Where the maneuver takes place, ornullwhen the backend omits it. -
getPoints
-
toString
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-