feat: More Mapbox mappings

This commit is contained in:
Piotr Dec 2024-08-02 00:55:05 +02:00
parent ac24c6ed2f
commit c3d553ece0
Signed by: stawros
GPG key ID: F89F27AD8F881A91

View file

@ -14,27 +14,38 @@ class MapboxMapper {
"roundabout" -> {
direction.out = OutType.RightRoundabout
}
"fork" -> direction.out = OutType.LongerLane
"arrive" -> {
// flag = true
direction.out = OutType.Flag
direction.angle = OutAngle.Right
}
"turn" -> {
when (this.type) {
when (this.modifier) {
"straight" -> direction.angle = OutAngle.Straight
"slight right" -> direction.angle = OutAngle.EasyRight
"slight left" -> direction.angle = OutAngle.EasyLeft
"sharp right" -> direction.angle = OutAngle.SharpRight
"sharp left" -> direction.angle = OutAngle.SharpLeft
"uturn" -> direction.angle = OutAngle.LeftDown
}
}
}
when (this.modifier) {
"right" -> {
direction.angle = OutAngle.Right
when (this.type) {
"turn" -> direction.angle = OutAngle.Right
"roundabout" -> {
when (this.degrees) {
137.0 -> direction.angle = OutAngle.EasyRight
180.0 -> direction.angle = OutAngle.Straight
when (this.degrees!!.toInt()) {
in 22..66 -> direction.angle = OutAngle.SharpRight
in 67..111 -> direction.angle = OutAngle.Right
in 112..156 -> direction.angle = OutAngle.EasyRight
in 157..203 -> direction.angle = OutAngle.Straight
in 204..248 -> direction.angle = OutAngle.EasyLeft
in 249..293 -> direction.angle = OutAngle.Left
in 294..338 -> direction.angle = OutAngle.SharpLeft
else -> direction.angle = OutAngle.Down
}
}
"off ramp" -> {
"fork", "off ramp" -> {
direction.angle = OutAngle.EasyRight
direction.out = OutType.LongerLane
}
@ -42,9 +53,9 @@ class MapboxMapper {
}
"left" -> {
direction.angle = OutAngle.Left
when (this.type) {
"turn" -> direction.angle = OutAngle.Left
"off ramp" -> {
"fork", "off ramp" -> {
direction.angle = OutAngle.EasyLeft
direction.out = OutType.LongerLane
}