Skip to content

Commit a7927d9

Browse files
ValueOnEdge.percentAlong
1 parent 09fc66f commit a7927d9

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

gradle/artifact-settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def getVersionName() {
2323
// def cmd = ["git", "describe", "--tag", "--match", "$prefix*", "--abbrev=0"]
2424
// def version = cmd.execute().text
2525
// return project.ext.snapshot ? getSnapshotVersion(version) : getReleaseVersion(version)
26-
return "2.17.0-adas-preview-2-SNAPSHOT"
26+
return "2.17.0-adas-preview-3-SNAPSHOT"
2727
}
2828

2929
def getReleaseVersion(String version) {

libnavigation-core/src/main/java/com/mapbox/navigation/core/adasis/ValueOnEdge.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
1516
class 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

Comments
 (0)