Package globus.glroute
Class GLRoute
java.lang.Object
globus.glmap.GLNativeObject
globus.glroute.GLRoute
@ParametersAreNonnullByDefault
public class GLRoute
extends globus.glmap.GLNativeObject
GLMapRouteData used store route data.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceGLRoute.BikeTypestatic interfaceGLRoute.Mode -
Method Summary
Modifier and Type Method Description static intfindInsertionIndex(globus.glmap.MapPoint point, globus.glmap.MapPoint[] points)Finds index where given point must be inserted to array of reference points.doublegetDuration()Returns estimated duration of the trackdoublegetDurationOfLeg(int index)Returns duration of legGLRouteManeuvergetFirstManeuver()Returns last maneuver in routeGLRouteElevationgetHeightData()Returns height data that was previously requested for this routeGLRouteManeuvergetLastManeuver()Returns last maneuver in routedoublegetLength()Returns total length of the trackdoublegetLengthOfLeg(int index)Returns length of legGLRouteManeuvergetNextManeuver(GLRouteManeuver maneuver)Returns next maneuver that goes after the given maneuverjava.lang.String[]getNextStreetNames(GLRouteManeuver maneuver)intgetNumberOfLegs()Returns number of legsintgetNumberOfTargetPoints()Returns number of target pointsGLRouteManeuvergetPreviousManeuver(GLRouteManeuver maneuver)Returns previous maneuver that goes before the given maneuverjava.lang.StringgetServerResponse()Returns server response stringGLRoutePointgetTargetPoint(int index)Returns target pointint[]getTrackCoordinates()Returns track coordinates in pairs (x, y) If track contains several lines - (-1, -1) split one segment from otherglobus.glmap.GLMapTrackDatagetTrackData(int trackColor)Returns track data that can be used to display track of routestatic GLRouteParseServerResponse(java.lang.String serverResponse)Creates GLMapRouteData from stringMethods inherited from class globus.glmap.GLNativeObject
disposeMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
getNumberOfTargetPoints
public int getNumberOfTargetPoints()Returns number of target points- Returns:
- number of target points
-
getTargetPoint
Returns target point- Parameters:
index- index of target point- Returns:
- target point
-
getTrackData
public globus.glmap.GLMapTrackData getTrackData(int trackColor)Returns track data that can be used to display track of route- Parameters:
trackColor- color of route track- Returns:
- track data of route
-
getTrackCoordinates
@Nullable public int[] getTrackCoordinates()Returns track coordinates in pairs (x, y) If track contains several lines - (-1, -1) split one segment from other- Returns:
- track coordinates
-
getLength
public double getLength()Returns total length of the track- Returns:
- length of the track in meters
-
getDuration
public double getDuration()Returns estimated duration of the track- Returns:
- duration of the track in seconds
-
getNumberOfLegs
public int getNumberOfLegs()Returns number of legs- Returns:
- number of legs
-
getLengthOfLeg
public double getLengthOfLeg(int index)Returns length of leg- Parameters:
index- index of leg- Returns:
- length of leg
-
getDurationOfLeg
public double getDurationOfLeg(int index)Returns duration of leg- Parameters:
index- index of leg- Returns:
- duration of leg
-
getNextManeuver
Returns next maneuver that goes after the given maneuver- Parameters:
maneuver- maneuver- Returns:
- next maneuver after the given maneuver
-
getPreviousManeuver
Returns previous maneuver that goes before the given maneuver- Parameters:
maneuver- maneuver- Returns:
- previous maneuver after the given maneuver
-
getFirstManeuver
Returns last maneuver in route- Returns:
- last maneuver in route
-
getLastManeuver
Returns last maneuver in route- Returns:
- last maneuver in route
-
getHeightData
Returns height data that was previously requested for this route- Returns:
- height data
-
getServerResponse
@NonNull public java.lang.String getServerResponse()Returns server response string- Returns:
- server response string
-
ParseServerResponse
Creates GLMapRouteData from string- Parameters:
serverResponse- string that was returned by GLMapRouteData#getServerResponse- Returns:
- GLMapRouteData or null if data is invalid
-
findInsertionIndex
public static int findInsertionIndex(globus.glmap.MapPoint point, globus.glmap.MapPoint[] points)Finds index where given point must be inserted to array of reference points. It's used, for example, to add way point to route.- Parameters:
point- At input defines point to insert. At output contains point that is located on route.points- Array of reference points- Returns:
- -1 if given point is too far from track.
-
getNextStreetNames
- Parameters:
maneuver- First maneuver to start search- Returns:
- First non empty array of streetNames from given maneuver to the end of route
-