@@ -9,11 +9,13 @@ import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
99 * Integer part is an index of edge segment and fraction is a position on the segment:
1010 * 0 - left point, 1 - right point, 0.5 - in the middle between the segment points.
1111 * Ex.: 3.5 means the middle the the 3rd segment on the Edge shape, shape has more then 4 points
12+ * @param percentAlong Position along edge shape [0-1]
1213 * @param value Floating point value, e.g. curvature in 1/m or slope as {elevation diff}/{horizontal length}
1314 */
1415@ExperimentalPreviewMapboxNavigationAPI
1516class ValueOnEdge private constructor(
1617 val shapeIndex : Float ,
18+ val percentAlong : Double ,
1719 val value : Double ,
1820) {
1921
@@ -27,6 +29,7 @@ class ValueOnEdge private constructor(
2729 other as ValueOnEdge
2830
2931 if (shapeIndex != other.shapeIndex) return false
32+ if (percentAlong != other.percentAlong) return false
3033 if (value != other.value) return false
3134
3235 return true
@@ -37,6 +40,7 @@ class ValueOnEdge private constructor(
3740 */
3841 override fun hashCode (): Int {
3942 var result = shapeIndex.hashCode()
43+ result = 31 * result + percentAlong.hashCode()
4044 result = 31 * result + value.hashCode()
4145 return result
4246 }
@@ -45,7 +49,11 @@ class ValueOnEdge private constructor(
4549 * Returns a string representation of the object.
4650 */
4751 override fun toString (): String {
48- return " ValueOnEdge(shapeIndex=$shapeIndex , value=$value )"
52+ return " ValueOnEdge(" +
53+ " shapeIndex=$shapeIndex , " +
54+ " percentAlong=$percentAlong , " +
55+ " value=$value " +
56+ " )"
4957 }
5058
5159 internal companion object {
@@ -54,6 +62,7 @@ class ValueOnEdge private constructor(
5462 fun createFromNativeObject (nativeObj : com.mapbox.navigator.ValueOnEdge ) =
5563 ValueOnEdge (
5664 shapeIndex = nativeObj.shapeIndex,
65+ percentAlong = nativeObj.percentAlong,
5766 value = nativeObj.value
5867 )
5968 }
0 commit comments