Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineGradient appears to lose precision and doesn't match expected point on map. #9998

Closed
cafesilencio opened this issue Sep 22, 2020 · 3 comments
Assignees
Labels
needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else)

Comments

@cafesilencio
Copy link

cafesilencio commented Sep 22, 2020

The Nav. SDK has a feature we call the "vanishing route line" which will make the color of the route line transparent or some other color behind the puck. As the puck moves across the map the gradient line is updated so the line in front of the puck is one color and the line behind the puck is another color or transparent.

There seems to be some lack of precision between the position of the puck and the "vanishing point". Depending on the route length and perhaps other factors, the "vanishing point is in front of or behind the puck. It looks to be off by a few meters which isn't noticeable with our default camera zoom level. However we have a customer with a more zoomed in camera while navigating so the issue is more noticeable.

@1ec5 referenced ticket: #9694
cc @LukasPaczos @asheemmamoowala

Here is a screen shot. I calculated for the point designated with the red circle. However the vanishing point of the line is behind the circle. I would expect them visually line up.
Screenshot_20200922-101754

I'll include the route as well as the calculations I"m using. If there's other information I can provide please let me know. The red circle in the screen shot is the point at index 12 in the route line coordinates. I chose that point arbitrarily.

val lineString = LineString.fromPolyline(route.geometry()!!, Constants.PRECISION_6)

val length = TurfMeasurement.length(lineString.coordinates().subList(12, lineString.coordinates().size), TurfConstants.UNIT_METERS)
---length = 363353.1325548031


val distanceRemaining = myCalculation()  // very similar result to turf calculation
---distanceRemaining = 363353.1325548029


val distanceTraveled = (route.distance() - distanceRemaining)
---distanceTraveled = 2169.667445197061


val percentTraveled = (distanceTraveled / route.distance())
---percentTraveled = 0.00593579236424393

This is how I create the gradient line expression:

trafficExpressions = [
Expression.stop(0.00593579236424393, Expression.color(segmentColor))
Expression.stop(0.051385016333661826, Expression.color(segmentColor))
Expression.stop(0.05252378378174234, Expression.color(segmentColor))
Expression.stop(0.05319443794421766, Expression.color(segmentColor))
Expression.stop(0.053948409333950155, Expression.color(segmentColor))
Expression.stop(0.1586817388270144, Expression.color(segmentColor))
Expression.stop(0.15900684464579026, Expression.color(segmentColor))
Expression.stop(0.18541839670125, Expression.color(segmentColor))
Expression.stop(0.18545717823212474, Expression.color(segmentColor))
Expression.stop(0.20198171388773753, Expression.color(segmentColor))
Expression.stop(0.20281321096908472, Expression.color(segmentColor))
Expression.stop(0.9994448672308583 Expression.color(segmentColor))
Expression.stop(0.9997063993050305, Expression.color(segmentColor))
]

Expression.step(
            Expression.lineProgress(),
            Expression.rgba(0, 0, 0, 0),
            trafficExpressions
        )

The resulting expression is:

["step", ["line-progress"], ["rgba", 0.0, 0.0, 0.0, 0.0], 0.0059357923, ["rgba", 86.0, 168.0, 251.0, 1.0], 0.051385015, ["rgba", 255.0, 149.0, 0.0, 1.0], 0.052523784, ["rgba", 86.0, 168.0, 251.0, 1.0], 0.053194437, ["rgba", 255.0, 149.0, 0.0, 1.0], 0.05394841, ["rgba", 86.0, 168.0, 251.0, 1.0], 0.15868174, ["rgba", 86.0, 168.0, 251.0, 1.0], 0.15900685, ["rgba", 86.0, 168.0, 251.0, 1.0], 0.1854184, ["rgba", 86.0, 168.0, 251.0, 1.0], 0.18545718, ["rgba", 86.0, 168.0, 251.0, 1.0], 0.20198171, ["rgba", 86.0, 168.0, 251.0, 1.0], 0.20281321, ["rgba", 86.0, 168.0, 251.0, 1.0], 0.99944484, ["rgba", 86.0, 168.0, 251.0, 1.0], 0.9997064, ["rgba", 86.0, 168.0, 251.0, 1.0]]

This is the route I used:

{"routeIndex":"0","distance":365522.8,"duration":13077.7,"geometry":"qextfAdu~kfFdMoTvCeLKuLeCuK{Fe[?qGrAoGlOcVx[kl@h\\am@zKwOvuTmd[z|DywF`O_S`}AuwBdwByzCjyA}rBxx@qkA~aNaqRrzEo{GbbKkuNrsAwkBfMyPd_@}h@hP{U`~@qqAnXc`@|s@gcA`eAazAhxCudE|k@{v@vr@m|@nxCatDf_@ke@rgFopGnuCcpDtm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p}BaW~b@w@bZvA`StDtTbF`\\jO`c@zOxF~E`D`HzBfS`Af`@|Aro@qNBaHmAqEqCsBuCsDkHcJaWyIkO{GqHw`@uUiR_KaKwCae@qLmDu@[IoTmE[IqOaEwG_@sGN}ALsMjA_eApM}_Bn]m~@`S_s@lOrO~mA","weight":13142.0,"weight_name":"routability","legs":[{"distance":365522.8,"duration":13077.7,"summary":"West Side Freeway, West Side Freeway","steps":[{"distance":140.7,"duration":24.9,"geometry":"qextfAdu~kfFdMoTvCeLKuLeCuK{Fe[","name":"","mode":"driving","maneuver":{"location":[-121.323363,37.581417],"bearing_before":0.0,"bearing_after":130.0,"instruction":"Head southeast","type":"depart","modifier":"left"},"voiceInstructions":[{"distanceAlongGeometry":140.7,"announcement":"Head southeast, then take the ramp","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eHead southeast, then take the ramp\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":84.8,"announcement":"Take the ramp, then merge left onto I-5 South","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eTake the ramp, then merge left onto \u003csay-as interpret-as\u003d\"address\"\u003eI-5\u003c/say-as\u003e South\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"}],"bannerInstructions":[{"distanceAlongGeometry":140.7,"primary":{"text":"Take the ramp","components":[{"text":"Take the ramp","type":"text"}],"type":"turn","modifier":"straight"}},{"distanceAlongGeometry":84.8,"primary":{"text":"Take the ramp","components":[{"text":"Take the ramp","type":"text"}],"type":"turn","modifier":"straight"},"sub":{"text":"I-5 South","components":[{"text":"I-5","type":"icon","imageBaseURL":"https://s3.amazonaws.com/mapbox/shields/v3/i-5"},{"text":"South","type":"text","abbr":"S","abbr_priority":0}],"type":"merge","modifier":"slight left"}}],"driving_side":"right","weight":25.0,"intersections":[{"location":[-121.323363,37.581417],"bearings":[130],"entry":[true],"out":0},{"location":[-121.322386,37.581187],"bearings":[75,240,270],"entry":[true,false,false],"in":1,"out":0}]},{"distance":234.1,"duration":26.3,"geometry":"a_xtfA|{{kfF?qGrAoGlOcVx[kl@h\\am@","name":"","mode":"driving","maneuver":{"location":[-121.321935,37.581313],"bearing_before":70.0,"bearing_after":88.0,"instruction":"Take the ramp","type":"on ramp","modifier":"straight"},"voiceInstructions":[{"distanceAlongGeometry":214.1,"announcement":"Merge left onto I-5 South","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eMerge left onto \u003csay-as interpret-as\u003d\"address\"\u003eI-5\u003c/say-as\u003e South\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"}],"bannerInstructions":[{"distanceAlongGeometry":234.1,"primary":{"text":"I-5 South","components":[{"text":"I-5","type":"icon","imageBaseURL":"https://s3.amazonaws.com/mapbox/shields/v3/i-5"},{"text":"South","type":"text","abbr":"S","abbr_priority":0}],"type":"merge","modifier":"slight left"}}],"driving_side":"right","weight":31.9,"intersections":[{"location":[-121.321935,37.581313],"bearings":[90,255,270],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0}]},{"distance":359724.5,"duration":12521.900000000001,"geometry":"{qutfAhxwkfFzKwOvuTmd[z|DywF`O_S`}AuwBdwByzCjyA}rBxx@qkA~aNaqRrzEo{GbbKkuNrsAwkBfMyPd_@}h@hP{U`~@qqAnXc`@|s@gcA`eAazAhxCudE|k@{v@vr@m|@nxCatDf_@ke@rgFopGnuCcpDtmE{rFp_G_mHvHiJbrDoqE~}FyjHf|BuqCpyDy_Fjb@ql@xkA_gB`}EqnHj~EsoHrg@yp@`r@qy@v~BqaCpLmLd`GmbGp}MaaNjKmKrzI{}I|tActA~p@qt@zp@gl@vp@cp@dv@wq@fc@ad@~^ua@lqAqtAh}@a}@dtBqwB~OeMli@ee@zj@g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lh@ef@dq@um@nn@sm@dsDilDdcBs`B|sHwgHdyMicM~lYifXn{D}}D~hEgzEvmRukTjhP_zQpyYe_\\v{Ga|HneM}fNv|KodMpqLqvMhgGiaH~dBcmBjlEk}E`lAgsAjjCawCdx@aeAxVo\\bZub@`}@uqAjyLwbRtwQkzXrzc@ivq@`bB}lCzhFy{HpxGodKlgH}uKrfAa`B`}CmxExbc@}tp@pzFixIzwA}wBpaXkea@hdCgrDfXqa@rr@seAfd@{s@tuAevB|~I_bNtkGwrJfeFa~HveFwbI~iEitGxzDueGl~DeoGjiE_}GdcEcsGjyFc_JxsCouExbIsdMzvF_|Ip{G_rKjzF}`JjwGkfKv|FygJrvHsqLbbGkrJnlHifL|vF_yIfqFe|HplGuyIjqDgfFzm@c|@jzH}dKt~Le~Mjr@}u@rq]kq_@`|C{eDlgJ__K`_AecAblY_c[dbYcyZxzXypZjzR}`ThvLiqM`nCeuChuLmtMtsLyaNpaRmhTxi@}n@dkA{nAfsKg~LnwKoeMrgC{tC|yFiuGxVkYvjM__OfrLw}MvwJu~KxcMarNn~I}aKbzHy|I~rIywJhuIywJhbJchK~`JydKrqHsdIt[m]ljIs`JflIgaJ|eJgcKjYq[bwH{kI`zGipHvbGgtGvdDomDnjEeyEx_@cb@xUcUvuCmcDtdFcuFzxAatAjaIgkHvgI}hHr_CiwBr|@kx@~{@s{@|h@mk@rh@_n@jnAo~AtiH}hJxaDceE~iAkzAbQqQlYkZta@g]d^aXt]}Ur\\sRxW_N","name":"West Side Freeway (I-5 South)","ref":"I-5 South","mode":"driving","maneuver":{"location":[-121.319829,37.580078],"bearing_before":127.0,"bearing_after":133.0,"instruction":"Merge left onto I-5 South","type":"merge","modifier":"slight left"},"voiceInstructions":[{"distanceAlongGeometry":359704.5,"announcement":"Continue on I-5 South for 224 miles","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eContinue on \u003csay-as interpret-as\u003d\"address\"\u003eI-5\u003c/say-as\u003e South for 224 miles\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":3219.0,"announcement":"In 2 miles, keep left onto I-5 South","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eIn 2 miles, keep left onto \u003csay-as interpret-as\u003d\"address\"\u003eI-5\u003c/say-as\u003e South\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":804.0,"announcement":"In a half mile, keep left onto I-5 South","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eIn a half mile, keep left onto \u003csay-as interpret-as\u003d\"address\"\u003eI-5\u003c/say-as\u003e South\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":402.0,"announcement":"Keep left onto I-5 South","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eKeep left onto \u003csay-as interpret-as\u003d\"address\"\u003eI-5\u003c/say-as\u003e South\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"}],"bannerInstructions":[{"distanceAlongGeometry":359724.5,"primary":{"text":"I-5 South","components":[{"text":"I-5","type":"icon","imageBaseURL":"https://s3.amazonaws.com/mapbox/shields/v3/i-5"},{"text":"South","type":"text","abbr":"S","abbr_priority":0}],"type":"fork","modifier":"left"}}],"driving_side":"right","weight":12525.800000000003,"intersections":[{"location":[-121.319829,37.580078],"bearings":[134,309,314],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-121.270726,37.542226],"bearings":[134,141,314],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-121.264721,37.537588],"bearings":[134,312,314],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-121.183582,37.466617],"bearings":[135,150,315],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-121.178062,37.460454],"bearings":[151,326,332],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-121.14082,37.400793],"bearings":[151,155,331],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-121.136256,37.394234],"bearings":[151,328,331],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-121.111023,37.328045],"bearings":[166,171,345],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-121.109262,37.322642],"bearings":[165,338,345],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-121.103912,37.304068],"bearings":[165,180,345],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-121.103139,37.300643],"bearings":[167,346,350],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-121.090078,37.250003],"bearings":[165,180,345],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-121.088232,37.242738],"bearings":[167,346,348],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-121.032257,37.12967],"bearings":[150,300,330],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-121.032097,37.129415],"bearings":[150,165,330],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-121.028694,37.124202],"bearings":[154,328,334],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-121.018049,37.108795],"bearings":[150,165,330],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-121.014662,37.104639],"bearings":[148,324,326],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-120.972947,37.059697],"bearings":[143,145,322],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.970653,37.057306],"bearings":[150,315,330],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-120.970465,37.05709],"bearings":[135,150,330],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.966244,37.052782],"bearings":[142,320,322],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.843606,36.932723],"bearings":[136,142,316],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.837499,36.927261],"bearings":[140,315,321],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.785565,36.866872],"bearings":[151,157,331],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.780729,36.859819],"bearings":[150,315,330],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.776451,36.853653],"bearings":[151,157,331],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.772514,36.847952],"bearings":[150,315,330],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.726786,36.781474],"bearings":[150,165,330],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.723241,36.776275],"bearings":[150,315,330],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.660209,36.687899],"bearings":[150,165,330],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.656758,36.68337],"bearings":[150,315,330],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.625359,36.642524],"bearings":[148,154,328],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.620656,36.636392],"bearings":[150,315,330],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.58953,36.607274],"bearings":[133,141,313],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.583198,36.602498],"bearings":[132,308,314],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.491545,36.533272],"bearings":[134,139,313],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.4855,36.528713],"bearings":[134,309,314],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.396553,36.438141],"bearings":[144,149,324],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.391572,36.432596],"bearings":[150,315,330],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.27129,36.297047],"bearings":[146,156,325],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.267304,36.29102],"bearings":[153,328,333],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.246428,36.257896],"bearings":[150,165,330],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.243188,36.252763],"bearings":[153,329,333],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-120.241882,36.250692],"bearings":[153,329,333],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-120.162126,36.141068],"bearings":[144,149,324],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.15711,36.135558],"bearings":[150,315,330],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.118449,36.093276],"bearings":[143,150,324],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.112869,36.087154],"bearings":[150,315,330],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-120.105181,36.07896],"bearings":[136,141,319],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-120.098397,36.074407],"bearings":[120,300,315],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-119.963207,35.984177],"bearings":[135,150,315],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.956775,35.978002],"bearings":[140,316,319],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-119.915498,35.937708],"bearings":[135,150,315],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.908975,35.931319],"bearings":[140,319,321],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-119.74235,35.735735],"bearings":[149,157,329],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.737024,35.728664],"bearings":[149,324,329],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-119.656866,35.620885],"bearings":[150,165,330],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.65121,35.613287],"bearings":[150,315,330],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-119.539459,35.504065],"bearings":[135,150,315],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.532791,35.497914],"bearings":[138,314,318],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-119.477872,35.457398],"bearings":[131,138,312],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.452757,35.439148],"bearings":[135,300,315],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-119.427318,35.420655],"bearings":[132,139,312],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.419858,35.415208],"bearings":[135,300,315],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-119.402348,35.402367],"bearings":[132,139,312],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.398927,35.39983],"bearings":[135,300,315],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-119.340028,35.357635],"bearings":[131,138,310],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.33277,35.352454],"bearings":[135,300,315],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-119.256296,35.296605],"bearings":[139,142,315],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.248629,35.289442],"bearings":[139,316,319],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-119.228402,35.270449],"bearings":[135,150,315],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.222258,35.264682],"bearings":[139,315,319],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-119.167633,35.213361],"bearings":[135,150,315],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.160172,35.206332],"bearings":[139,315,319],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-119.115157,35.165366],"bearings":[138,141,318],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.108306,35.159165],"bearings":[135,300,315],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-119.041023,35.098259],"bearings":[135,150,315],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-119.035813,35.093353],"bearings":[139,308,319],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0},{"location":[-119.002684,35.062415],"bearings":[135,150,315],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0},{"location":[-118.996401,35.056507],"bearings":[139,315,319],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0}]},{"distance":1301.4,"duration":47.2,"geometry":"kclxaAngs{aFdSuMxqDaiBlxAus@|t@k_@l{@qb@nfA_e@xl@sT`j@wQ~l@qOp]oHp[yJ","name":"West Side Freeway (I-5 South)","ref":"I-5 South","mode":"driving","maneuver":{"location":[-118.958216,35.019334],"bearing_before":153.0,"bearing_after":150.0,"instruction":"Keep left onto I-5 South","type":"fork","modifier":"slight left"},"voiceInstructions":[{"distanceAlongGeometry":1281.4,"announcement":"In 1 mile, merge left onto I-5 South","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eIn 1 mile, merge left onto \u003csay-as interpret-as\u003d\"address\"\u003eI-5\u003c/say-as\u003e South\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":804.0,"announcement":"In a half mile, merge left onto I-5 South","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eIn a half mile, merge left onto \u003csay-as interpret-as\u003d\"address\"\u003eI-5\u003c/say-as\u003e South\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":402.0,"announcement":"Merge left onto I-5 South","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eMerge left onto \u003csay-as interpret-as\u003d\"address\"\u003eI-5\u003c/say-as\u003e South\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"}],"bannerInstructions":[{"distanceAlongGeometry":1301.4,"primary":{"text":"I-5 South","components":[{"text":"I-5","type":"icon","imageBaseURL":"https://s3.amazonaws.com/mapbox/shields/v3/i-5"},{"text":"South","type":"text","abbr":"S","abbr_priority":0}],"type":"merge","modifier":"slight left"}}],"driving_side":"right","weight":47.2,"intersections":[{"location":[-118.958216,35.019334],"bearings":[150,165,330],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":0}]},{"distance":2238.2,"duration":85.19999999999999,"geometry":"agwwaAzah{aFvtBmd@lnBwa@t{I_nBr~R{hE","name":"Golden State Freeway (I-5 South)","ref":"I-5 South","mode":"driving","maneuver":{"location":[-118.952494,35.008641],"bearing_before":160.0,"bearing_after":164.0,"instruction":"Merge left onto I-5 South","type":"merge","modifier":"slight left"},"voiceInstructions":[{"distanceAlongGeometry":2218.2,"announcement":"In 1.5 miles, take exit 219B towards Laval Road West","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eIn 1.5 miles, take exit \u003csay-as interpret-as\u003d\"address\"\u003e219B\u003c/say-as\u003e towards Laval Road West\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":804.0,"announcement":"In a half mile, take exit 219B towards Laval Road West","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eIn a half mile, take exit \u003csay-as interpret-as\u003d\"address\"\u003e219B\u003c/say-as\u003e towards Laval Road West\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":402.0,"announcement":"Take exit 219B towards Laval Road West, then go straight onto Laval Road","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eTake exit \u003csay-as interpret-as\u003d\"address\"\u003e219B\u003c/say-as\u003e towards Laval Road West, then go straight onto Laval Road\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"}],"bannerInstructions":[{"distanceAlongGeometry":2238.2,"primary":{"text":"Exit 219B Laval Road West","components":[{"text":"Exit","type":"exit"},{"text":"219B","type":"exit-number"},{"text":"Laval Road","type":"text","abbr":"Laval Rd","abbr_priority":0},{"text":"West","type":"text","abbr":"W","abbr_priority":1}],"type":"off ramp","modifier":"right"}},{"distanceAlongGeometry":656.7,"primary":{"text":"Exit 219B Laval Road West","components":[{"text":"Exit","type":"exit"},{"text":"219B","type":"exit-number"},{"text":"Laval Road","type":"text","abbr":"Laval Rd","abbr_priority":0},{"text":"West","type":"text","abbr":"W","abbr_priority":1}],"type":"off ramp","modifier":"right"},"sub":{"text":"Laval Road","components":[{"text":"Laval Road","type":"text","abbr":"Laval Rd","abbr_priority":0}],"type":"turn","modifier":"straight"}}],"driving_side":"right","weight":91.0,"intersections":[{"location":[-118.952494,35.008641],"bearings":[165,341,348],"classes":["motorway"],"entry":[true,false,false],"in":1,"out":0},{"location":[-118.951339,35.004974],"bearings":[165,341,346],"classes":["motorway"],"entry":[true,false,false],"in":2,"out":0}]},{"distance":542.8,"duration":32.5,"geometry":"qeqvaAx`|zaFp}BaW~b@w@bZvA`StDtTbF`\\jO`c@zO","name":"","destinations":"Laval Road West","mode":"driving","maneuver":{"location":[-118.946333,34.989161],"bearing_before":164.0,"bearing_after":170.0,"instruction":"Take exit 219B towards Laval Road West","type":"off ramp","modifier":"slight right"},"voiceInstructions":[{"distanceAlongGeometry":542.8,"announcement":"Go straight onto Laval Road","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eGo straight onto Laval Road\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"}],"bannerInstructions":[{"distanceAlongGeometry":542.8,"primary":{"text":"Laval Road","components":[{"text":"Laval Road","type":"text","abbr":"Laval Rd","abbr_priority":0}],"type":"turn","modifier":"straight"}}],"driving_side":"right","weight":32.6,"intersections":[{"location":[-118.946333,34.989161],"bearings":[166,171,346],"classes":["motorway"],"entry":[true,true,false],"in":2,"out":1}],"exits":"219B"},{"distance":183.3,"duration":29.1,"geometry":"_}gvaAxw|zaFxF~E`D`HzBfS`Af`@|Aro@","name":"Laval Road","mode":"driving","maneuver":{"location":[-118.946701,34.984416],"bearing_before":199.0,"bearing_after":215.0,"instruction":"Go straight onto Laval Road","type":"turn","modifier":"straight"},"voiceInstructions":[{"distanceAlongGeometry":163.3,"announcement":"In 600 feet, turn right onto Dennis Mccarthy Drive","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eIn 600 feet, turn right onto Dennis Mccarthy Drive\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":94.5,"announcement":"Turn right onto Dennis Mccarthy Drive","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eTurn right onto Dennis Mccarthy Drive\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"}],"bannerInstructions":[{"distanceAlongGeometry":183.3,"primary":{"text":"Dennis Mccarthy Drive","components":[{"text":"Dennis Mccarthy Drive","type":"text","abbr":"Dennis Mccarthy Dr","abbr_priority":0}],"type":"turn","modifier":"right"}}],"driving_side":"right","weight":44.199999999999996,"intersections":[{"location":[-118.946701,34.984416],"bearings":[15,30,210],"entry":[false,false,true],"in":0,"out":2},{"location":[-118.947282,34.984148],"bearings":[75,90,270],"entry":[false,false,true],"in":0,"out":2}]},{"distance":1038.9,"duration":225.0,"geometry":"gggvaA~m`{aFqNBaHmAqEqCsBuCsDkHcJaWyIkO{GqHw`@uUiR_KaKwCae@qLmDu@[IoTmE[IqOaEwG_@sGN}ALsMjA_eApM}_Bn]m~@`S_s@lO","name":"Dennis Mccarthy Drive","mode":"driving","maneuver":{"location":[-118.948592,34.984068],"bearing_before":265.0,"bearing_after":358.0,"instruction":"Turn right onto Dennis Mccarthy Drive","type":"turn","modifier":"right"},"voiceInstructions":[{"distanceAlongGeometry":1018.9000000000001,"announcement":"Continue on Dennis Mccarthy Drive for a half mile","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eContinue on Dennis Mccarthy Drive for a half mile\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":323.2,"announcement":"In a quarter mile, turn left","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eIn a quarter mile, turn left\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"},{"distanceAlongGeometry":69.3,"announcement":"Turn left, then you will arrive at your destination","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eTurn left, then you will arrive at your destination\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"}],"bannerInstructions":[{"distanceAlongGeometry":1038.9,"primary":{"text":"Turn left","components":[{"text":"Turn left","type":"text"}],"type":"turn","modifier":"left"}}],"driving_side":"right","weight":258.7,"intersections":[{"location":[-118.948592,34.984068],"bearings":[0,90,180,270],"entry":[true,false,true,true],"in":1,"out":0}]},{"distance":118.9,"duration":85.6,"geometry":"g`xvaAbw~zaFrO~mA","name":"","mode":"driving","maneuver":{"location":[-118.947714,34.99266],"bearing_before":344.0,"bearing_after":254.0,"instruction":"Turn left","type":"turn","modifier":"left"},"voiceInstructions":[{"distanceAlongGeometry":6.9,"announcement":"You have arrived at your destination, on the left","ssmlAnnouncement":"\u003cspeak\u003e\u003camazon:effect name\u003d\"drc\"\u003e\u003cprosody rate\u003d\"1.08\"\u003eYou have arrived at your destination, on the left\u003c/prosody\u003e\u003c/amazon:effect\u003e\u003c/speak\u003e"}],"bannerInstructions":[{"distanceAlongGeometry":118.9,"primary":{"text":"You will arrive","components":[{"text":"You will arrive","type":"text"}],"type":"arrive","modifier":"left"}},{"distanceAlongGeometry":6.9,"primary":{"text":"You have arrived","components":[{"text":"You have arrived","type":"text"}],"type":"arrive","modifier":"left"}}],"driving_side":"right","weight":85.6,"intersections":[{"location":[-118.947714,34.99266],"bearings":[165,255,345],"entry":[false,true,true],"in":0,"out":1}]},{"distance":0.0,"duration":0.0,"geometry":"sowvaAbfa{aF","name":"","mode":"driving","maneuver":{"location":[-118.948978,34.992394],"bearing_before":256.0,"bearing_after":0.0,"instruction":"You have arrived at your destination, on the left","type":"arrive","modifier":"left"},"voiceInstructions":[],"bannerInstructions":[],"driving_side":"right","weight":0.0,"intersections":[{"location":[-118.948978,34.992394],"bearings":[76],"entry":[true],"in":0}]}],"annotation":{"distance":[39.457683969855815,20.429643000155142,19.31546388701677,19.383376469815435,42.151658271734426,12.07594374203922,12.865859517972421,43.8107149014513,82.00249876393794,83.3159262678401,32.90979952036431,1773.4801056764848,487.19891400486955,40.16290241507874,238.75791469689835,306.69303891640067,229.3844511347637,149.16816084461865,1232.4692392332731,560.2590552532611,988.4887087517056,215.00924588945972,35.705542165635116,82.36038000928671,44.62266279252553,161.7671211455318,65.14881721330502,134.72590193902673,179.05213081755167,390.21628024962575,112.3085068178305,126.48732766748246,374.0562702200034,78.91204181497822,566.022338738973,366.37671035086595,503.76815909924653,624.6476495730199,23.580845691625047,435.78668748671646,620.5355929485809,304.24677424125787,459.3069130944839,90.00523738812917,200.61121971259033,582.9759342981573,585.6776197932169,100.86479352128967,122.86260740934586,292.70030410591187,30.70132369845246,586.2544613669454,1090.3027636785378,28.1697019141576,792.6420901426757,194.53641615551516,116.79381249869645,109.37457672424729,112.48558719969778,121.58951178071291,83.07916174994739,75.12371347376222,190.07691294022038,141.35811538222256,269.24803846226035,36.28918071722223,92.80865220624487,93.37382104482288,97.36722992227166,112.58067919560727,113.51999750344203,416.23224408133666,245.13160041604485,121.48676218229296,123.46090669235909,30.63731035158446,28.51964401351739,55.44023257246902,60.078515797048986,161.96073255937614,122.74427716610377,104.71224452374346,177.4166954499167,105.09285168679412,558.092826468196,99.61613866897075,199.54068728270474,163.011473420017,220.45981599960922,329.34347762479786,230.38712656717203,235.99921149482782,273.66408247955394,155.22662391740656,317.3325794623108,67.66059417866867,184.10395621337918,44.18501057731673,561.2180116023499,143.1272376892104,176.85280230159364,171.74305369660152,231.411155434047,261.9463076653843,216.46969407186694,326.56519204508805,389.26316642892573,408.6106323485216,48.8487177626266,224.75797350953962,151.37059039507037,86.84569281659924,227.0322385530386,492.83152356445316,229.6446265545721,64.56598799937598,86.27078352093567,110.602578896902,156.4642230686542,332.83397691017274,312.59496016314796,346.98419913594984,26.51545837850141,324.18447248512933,943.3043242346923,1136.234697838074,271.3708482185763,162.07904088251718,70.4410089318893,253.4559499964517,270.5047377729205,88.20393861946368,76.37349031427301,301.9172640169196,102.39767059314975,304.8114703140136,306.77474230489275,497.926170337993,88.45141872556638,51.265808358978816,465.95177465234036,154.86096744823737,421.0452183016587,38.05576635451684,167.71734102071002,83.16492584521924,83.81403380767844,240.2269945833213,240.1525815205096,327.02125847943734,480.32682592051304,38.59231376412736,31.886025686359286,355.2371400203208,103.02283332225393,234.87078388766184,1687.3922268973447,26.494586781506346,1218.6359033544372,546.5376231106037,143.99206996024407,555.7776874739261,342.6176786215966,590.8666985660035,188.9580344560671,111.00834328603307,440.3557483332646,246.69601548438015,137.37214049610063,50.64861181988567,103.32546441597023,141.61733627427122,145.41099171144398,163.63002324292674,141.09099459206647,92.5583213010134,140.67819540709283,140.11127792171152,126.79509553451093,90.1072383943965,149.12976462242756,278.1867323562029,145.7910478653242,98.65282176329217,189.55866649380246,145.79244444110756,143.8371765902997,134.34301996124933,102.68300871184968,87.62167458688674,369.03000956059395,147.84631949804566,152.25625747529753,140.94777455581547,149.27798320201828,281.06811046357683,214.36620722972964,261.8304091610628,133.34605157855066,143.01909661111102,65.38764333862444,64.51132507820171,60.19824666630068,85.30013731562998,144.26763380387968,153.65672954875396,167.12912373626608,159.0649893327977,319.765805849108,159.87167345163138,232.66663794417914,158.41966418655994,161.4341157610539,154.8751624609774,175.4744997988141,143.8955369582504,159.44043352635674,273.2006182896225,30.219193526536387,96.71932692632909,161.8490002973083,150.34866148772414,155.2056261314377,158.69900120807634,156.4559805111556,168.8500304533779,75.10565722240314,265.5028775317344,136.50985503126256,149.12336512277855,162.52884526743992,152.55481972078528,150.95626278668504,133.05931783628438,59.28824918353036,64.62015962462571,558.4828888411841,134.1891797857486,91.72161314052427,148.6600991939731,160.49908843093044,151.56075621765825,136.00460105637958,250.6184132364364,94.46100275313435,315.8012542126951,463.097492306972,155.45151552847597,287.9227862719731,202.925331822274,287.9392570480697,112.59032945430573,16.528767610617635,9.726914570954435,21.99305904718539,96.83675536377564,111.21283177633563,96.41778696328842,181.6941499285761,98.57742034391701,68.9362562202946,52.790871008411045,154.20659096784604,332.53992876470613,470.1578578539478,142.94122816207673,182.20261409268392,192.19619727481927,170.80290818185662,139.28613598143133,120.68159320451531,35.005031726836386,360.7084174370956,99.58143482411836,56.05437392659756,58.192507254842525,352.3501469040161,55.37432238461848,752.9373408155765,74.26606948690026,92.49249833100481,113.21342047442414,96.90932951670324,158.7938567667827,159.79177018779177,535.9793599802173,833.6631117274458,38.419745007568835,52.482351487984126,81.5878403434428,239.70809305867158,27.723166009202316,733.4592195137511,603.3386154828459,161.81667889021142,1001.0323427164258,334.9406833898408,29.251699989770557,14.175083466583228,85.16081870177788,230.50071768688431,278.42701281416925,816.517533241855,40.634696925652236,319.3500552706084,816.8620523877285,738.0403219254711,659.9052018401425,37.29111639287831,57.0165045169493,229.52270852942917,110.84460959713554,109.46638339636664,167.6878915510605,48.587521782323684,148.03998189968465,108.59173705267422,58.31968178955862,51.98343032262445,280.4985755703256,121.82459720286926,267.7361699702819,226.75308846294195,30.34026834717415,303.9214869554239,146.24234373723644,219.365001675045,144.2333679895098,72.60106563938783,90.84388185155024,144.41376848700648,232.33361549161424,83.14504005744433,227.77017815698278,105.00380010768016,139.0401535040281,222.88125268843007,184.54097792293473,314.82325360631563,149.4950421472475,85.46310533034283,144.94311914743594,134.45015967381423,132.45050626148597,116.94471758523605,374.9776367096444,158.66105957718182,192.0011323225644,167.25842771937099,285.69643842306084,160.99931677397748,347.0908344511612,262.1576891132252,90.35391099875092,150.60266460996093,273.88444523707483,37.828583330040836,42.018149646341364,71.72868983808401,65.2037539952504,45.9170549885087,52.40552836316854,63.54867031713524,37.57343771980574,63.05950678414613,69.85186541557242,138.95199184630857,309.3188505417933,231.74449829470683,155.36493497214366,68.86245990918687,84.41363326503534,583.0146731491915,46.05138015908037,54.31615057690298,87.3360915250587,339.04089951488845,144.48108874007346,180.11192513456908,93.5972614213266,107.49135637074433,89.80683654550117,60.986274885965145,79.99134986959645,65.7157602244101,83.13825770667617,37.9695721949686,176.60060687979532,92.48147922553865,26.021072097064785,24.214128608032716,27.27883341358653,52.81284376100606,26.729561379447922,32.6725300303464,63.175304432849224,33.018180872317394,55.12484087946546,35.47152782793502,35.32990851171644,29.24526325922835,19.166313291726567,21.13239900311371,51.901558308774696,141.00953696969705,68.75695802676435,294.2745865330761,305.50927353335834,229.80867782127387,49.48814677965676,79.2732289344011,72.9668999274815,90.06219085701834,103.29947375386963,49.79707317910231,89.82313724628743,194.66952844711906,23.807162597724425,58.11759612762457,270.32425266892284,114.98262557964136,153.27608474034753,10.36458360819366,140.54519381297928,117.99808533739139,304.0472585069677,121.89824339743552,72.22884992535356,206.50692936772344,55.98081004529561,165.10807230141364,101.09468902640451,46.192114931520095,65.66561927480231,39.20957187699921,36.497890908819436,15.006682815846563,27.658272670382587,41.374358680805145,122.54847331931276,138.24752616102734,40.18228527295804,208.32687620600603,55.87989124923911,47.508711931824685,53.62381901966068,45.48411174207723,50.63071878616821,35.484692576223985,48.647411099283666,73.81779331420819,54.19202246413956,73.0981842451886,37.441023396076595,94.61097631590009,101.79732358123897,141.34643127414975,125.89138371447584,568.5222323784138,854.0022407659212,288.77754801678054,225.2811040110919,31.468177890432177,51.830741130215486,334.55778655106053,273.3760350490024,288.9083087142549,265.4386493191334,315.13167048313744,325.0618810186468,288.1347259257638,275.28962831924787,265.86902748087766,410.61246503265426,241.37803365279174,254.7002242021516,301.35370832739346,97.34047019087734,40.859677173542444,182.378747768136,241.82321044744518,155.46800703219228,67.61171797579681,96.30523046476698,629.6295342070458,94.8487072678124,1618.1220745311523,3824.7038136967544,54.55656651858155,2943.7554295498894,658.8846813156766,289.4609050184566,1578.7427351915494,612.0758900637794,4613.341618677778,792.9032305575446,1051.855636856698,521.3955851066604,181.44152592436032,696.4089844880438,596.1576060905587,391.5639010193577,59.368034291968335,259.27052378671635,230.41601565010518,41.335995538372615,70.71674948786772,872.6085984959451,68.10003395039746,126.99759257434157,1256.735345781985,341.5555571651602,375.86862647885147,977.4729921962925,59.70699316211409,1138.5767915507274,49.229417988993916,800.8477137197997,56.122194942059025,850.6911345714532,506.7620007444911,214.66583332133087,190.06753976095345,180.24916366182453,301.70108618779904,459.5082013813261,838.0048856466144,702.3910807594347,67.9936012257182,112.8091109203039,76.99853206687135,229.530786616805,110.50835266124665,117.98043162697215,60.010901167530506,201.03659720761001,827.5014485772525,4042.854356976645,366.41991460061865,414.1964619191843,2106.5694589332393,693.8516510273206,342.224759629149,385.53974396347553,292.9538740556992,358.4752527352241,502.35156068568125,307.29069187327195,93.453044852059,304.6123682573921,50.685639018051035,210.69206493885792,175.8738687363489,181.246333352627,46.338558968159106,76.15101318867967,50.98173182137489,373.181728438648,777.7196890114262,276.3126221199213,279.78755720562566,657.9044862475206,1004.5534414817381,1298.4662050857632,109.80575754974181,106.05078407160141,143.24151911876606,358.3375664442165,641.3860415269361,567.7723155220582,330.4431467528116,380.9611590541009,272.88701775794686,125.40662250297682,403.95731738833217,245.1138942217556,1019.080586730739,811.7172237758695,388.39128233942154,48.98659560663232,454.93765401219935,803.8229731805376,325.6513887800788,598.3762129156559,134.2601336075206,56.61820815636659,232.0820678185936,173.63787762360994,120.58049729667421,43.816357643303846,254.00057556111693,690.0668086340684,944.242167487672,49.838201654017396,194.57946106238106,492.9590835561969,585.4092257850126,528.534590881221,877.0847693388306,48.96392147092392,623.8205773850523,643.2956225194583,490.2401066835238,647.5359030549678,700.6430668387808,685.711752620704,400.88120789552215,626.9390403540698,619.2842340972396,880.7719994692263,52.28668971239807,394.0311962795495,547.1054159524698,387.36132044423243,502.22841048104124,472.12100349019516,661.7689314224298,767.5305362119933,882.2897992173083,649.5819724192609,463.39733657282636,482.6808885830442,515.5420272172037,539.0872736132961,229.44659589341975,68.80154968967936,121.7718825826886,254.26312672082534,259.5952285731478,55.677630277182075,607.9086031079336,1355.8597653827137,250.16848872326815,1918.6339422724884,640.6277854424774,258.4248540476183,177.11456643093842,142.0654949176455,1090.5321871513388,978.855040598459,62.81111516806323,1804.393435054214,852.8888624983708,922.2680751597626,867.5732091863105,1714.2796018974277,56.09676150493348,187.44127760517125,130.81859949824224,122.46361413905856,130.96511439352693,78.46579814624947,1281.7814189448827,87.39628435847749,3496.192410797394,708.8939088479912,51.76660987995983,3402.277757841816,1473.9523407007887,922.3978581047114,48.11531627435698,19.685659892551072,826.0148703843721,142.42678622193947,844.1981923810756,157.5571722594162,85.04228773205638,74.82275929246711,85.67672209330627,82.17414075476184,69.8462231772556,128.3678547971461,192.93428818692368,75.16685296316638,335.4068308589808,312.1218635432425,320.6867855123154,336.35399196017204,341.357663713986,672.4050722844703,501.1627065586099,274.6364957661567,357.222238101585,403.6276565736162,333.80548567191283,298.66458813737313,192.8789912425792,293.7843010610768,162.28061456724046,735.9240210546935,453.62164736879225,370.03375597500116,406.1134581276853,363.15665715514655,380.4555394762341,290.38027227927387,220.90502962743716,187.09397368498557,193.75349484235613,122.54321855414516,132.2074832140042,189.50925896770937,186.33202577485434,120.3039799006337,230.97905833349668,143.87676070081253,200.91437031034803,485.080327422808,444.5308929256444,100.02679710454402,178.0971765019871,172.30127308911236,234.59688801174033,225.11868269422956,328.9597464553391,75.4544704565606,61.57144678543362,46.05945764188902,57.18575956648457,55.36719178148568,71.61995235177308,66.56609486649968,42.376898265683835,62.841886484092235,59.63498023865765,74.63154450926531,65.44097062773253,56.11667959943994,37.44831282448429,30.815349375098453,76.36732901163296,55.49668559542413,29.16733138146232,101.06812305796163,76.5666450047905,73.00864360113728,180.8329953389904,293.83745765020655,139.045057082005,113.39794975156023,107.95737895660766,68.0758003348378,80.14192731444918,48.39227327821355,794.3762330512521,510.95023438386926,338.6576865919719,90.20121599310394,198.9133679346538,270.5590726422225,1176.0412803088661,252.94943093114594,103.83357176948203,194.426649268526,253.98161448514955,132.1932171674967,76.46688303017226,828.0775607962112,736.1431127910065,215.48430060036284,415.70150009970126,443.42264574219473,287.09559265888413,155.39159843218636,160.50839804886417,242.54466285846684,147.92022528923064,45.67642946518775,83.66426175182883,93.50972757084955,210.7729511050404,214.244904484723,71.5878487444728,78.57053016217623,124.39556868893939,498.35455152438703,496.72924340181794,756.1299499098034,344.5520702239093,354.41059832996905,262.7209722252894,312.7323943204408,270.85704074941884,264.362305963858,108.49438815678978,119.48675476712792,320.8759891538284,180.82573647949934,244.13091229059003,167.7866663711671,189.23225501742417,231.6637573709562,145.48648991184436,129.95156893995167,172.14163668082625,99.29560104587756,267.67493121308536,154.82827365369872,353.5392503918883,303.34977911715816,561.1978291486082,285.64490090655823,375.24791290569135,280.4311672993568,260.53603946840536,64.43828225380429,566.1507152316188,403.02312599031137,129.68392267185,629.1591393523834,525.7382539807485,563.0625418682678,653.3380264360457,440.9918036823842,293.10049384666337,291.5355864959978,865.0130024694555,5512.144800842377,1288.5124605126134,2983.9572346738196,2768.47684850526,921.843353928582,1188.5206474185547,2197.485459928485,4718.475231185928,5901.375691920077,987.7899566196874,808.0208645235462,138.60037379809245,99.25565800852168,93.02185884411065,111.98495935741897,108.1528915289483,407.08346921871066,227.4760192225257,697.6199664002802,1067.9905911709566,1905.8026095979426,434.65294108847496,479.5427400991937,1486.8671275811312,1316.085678618402,2034.973178154365,683.8451002628124,1074.082844506311,986.7443513201157,1031.8508644617257,630.9824616909892,241.67010649897276,487.21761023860444,183.5968793900053,331.7557375221883,143.74490578608518,60.189628893268186,70.73871527411907,162.95044558296917,1185.553394333749,1606.3457535206442,3153.239060748584,270.9493471280984,619.802673994693,754.9330463302213,791.4426405366675,189.8721975852807,422.50926688159774,3089.720117195528,671.7321441918305,236.17954341737703,2135.3195742316975,351.98789697355437,67.32688160316658,137.610946742654,101.37939078090312,231.71982987014965,939.8138003979338,720.7813067018184,618.2222021849165,623.9325395459786,540.76221349965,506.9609698801369,521.6074859232623,549.5131062864648,531.4857602927622,678.0090662982117,408.7209062336023,874.9712682219524,671.7215480577408,773.7354655387699,681.2577877646934,756.1642375332641,691.610216696382,840.0907557854428,709.5220968121193,815.915003807963,668.6807575747017,630.8974811089292,695.4355965663575,462.13284478500645,121.82014502650235,797.3455071810739,1057.9337906217438,121.35725516920333,2307.8720344306894,370.0161623095186,850.1512970927189,151.04474121439887,1993.124555869125,1970.5040374410416,1952.8101662791607,1496.1935586781049,1034.8697195803725,335.43075453418237,1036.564085756831,1047.368311397045,1470.706725786507,103.28096103911223,178.55584641356296,969.961457734931,982.6843739150437,326.5901577678439,602.8153020285197,57.16992577327846,1106.5232451617699,1041.7737503569435,903.0365840262574,1084.8566595777052,841.7075970459042,757.4734182409654,816.6900945995258,819.768350769911,852.880263460485,847.9410836415321,722.8864418884278,67.60705142890485,782.9843513690923,786.0361386819085,853.0799836687683,62.71844739344109,737.2872332712726,671.9518825521988,613.821198206604,389.38724044631925,481.8495589759294,77.64106046202316,51.836536433896185,359.66541316087967,543.7416350753291,202.33671269944233,721.4599597337565,728.5178463922521,288.32397373390626,137.9020762495199,139.9597442155889,98.80842578851625,100.88611681382507,198.2934466544508,748.8252795887629,409.04706799727484,188.54212350090978,42.09835899776174,61.68690691023543,75.85687702467192,66.44268951577858,64.03133911427574,59.980025319898814,49.2722121707689,41.81992977902432,353.7778231424031,176.72153589388853,106.95981735989497,119.3943162664984,138.77501736382195,87.40981166650081,81.36233567067815,85.3480658285289,56.12471563947733,53.667462482387855,216.539346877086,204.68336954965693,641.2812285029822,1175.7220536126126,227.9491850366726,64.11713755621425,48.438448234709874,36.65400914923439,39.969184317634124,56.96507343536604,68.73244664831601,17.247383231374613,15.992786025737031,30.32037696052878,48.619330725737505,71.09079840009299,27.695948393840336,16.514763150677332,13.440521826944456,9.398360796991827,16.942720465309097,40.285024369368536,30.664331238952503,21.06773532760396,68.56898034881367,38.56612773346852,22.55620708631503,70.56417520792905,9.984580527009811,1.6224581592047835,39.396252561172616,1.6224576010006564,30.771810782937376,15.639790413104171,15.366531239300134,5.2664087739871,26.256292060001474,126.36984405753935,178.1509578029508,116.62231190971043,95.59289942399563,118.91448769702836],"congestion":["low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","moderate","low","moderate","moderate","moderate","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","unknown","unknown","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","unknown","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","unknown","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","low","unknown","low","low"]}}],"routeOptions":{"baseUrl":"https://api.mapbox.com","user":"mapbox","profile":"driving-traffic","coordinates":[[-121.3233167,37.5814606],[-118.9488249,34.9919064]],"alternatives":true,"language":"en","continue_straight":false,"roundabout_exits":false,"geometries":"polyline6","overview":"full","steps":true,"annotations":"congestion,distance","voice_instructions":true,"banner_instructions":true,"voice_units":"imperial","access_token":"token_omitted","uuid":"ckfcs0i610b8w79p1kxhdusex"},"voiceLocale":"en-US"}
@karimnaaji karimnaaji added the needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else) label Sep 24, 2020
@1ec5
Copy link
Contributor

1ec5 commented Sep 25, 2020

referenced ticket: #9694

FYI, this issue was filed in the GL JS repository with the understanding that the gradient stop precision used by gl-native is based on the precision used in GL JS.

@zugaldia
Copy link
Member

/cc: @tmpsantos per the last comment.

@karimnaaji karimnaaji self-assigned this Oct 7, 2020
@karimnaaji
Copy link
Contributor

karimnaaji commented Oct 8, 2020

Thanks for the details and referring to #9694! Yes, you are correct in the asumption that both gl-js and gl-native are matching as those changes have been cross-ported.

Short answer: You're feeding wrong values to the gradient expression. On one hand there are distances that are calculated using harvesine formulas, which gets the distance between two locations on a sphere accounting for curvature, and mapbox-gl which calculates distances in tile space post-projection.

Concerning the remark about precision, we have provided a vast increase in the work of #9694 as well as an option to use hard transition, which you should be able to leverage. What you are dealing with isn't exactly a lack of precision, it is there, but you are introducing an error by comparing the wrong values. We are providing precision close to pixel accuracy without any dependency on the length of the route line, which should fit your use case. Without going into too much detail, we're tiling the gradient data instead of using a global one, where data would previously gradually degrade as either you zoomed in, or increased the distance of the line. I would also refer to the turf documentation concerning the details of the function you are using.

Now to fix this error, you need to to match the way mapbox-gl calculates line distances before it uses it to infer its gradient. You could do that by updating the way you are calculating the line length to match the way we do it instead of using turf, first the two projection functions we use (EPSG:3857):

function projectX(x) {
    return x / 360 + 0.5;
}

function projectY(y) {
    var sin = Math.sin(y * Math.PI / 180);
    var y2 = 0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;
    return y2 < 0 ? 0 : y2 > 1 ? 1 : y2;
}

Then the line distance calculation:

var distance_remaining = 0
for (let i = 0; i < remaining_line.geometry.coordinates.length - 1; ++i) {
    var curr = remaining_line.geometry.coordinates[i];
    var next = remaining_line.geometry.coordinates[i+1];
    const d = [projectX(next[0]) - projectX(curr[0]), projectY(next[1]) - projectY(curr[1])];
    distance_remaining += Math.sqrt(d[0] * d[0] + d[1] * d[1]);
}

Assuming you did the same distance calculation for the total route line distance, you can then can feed it to the gradient expression as such:

'line-gradient': [
    'step',
    ['line-progress'],
    "green",
    1.0 - distance_remaining / total_distance, "yellow"
]

Here's a full example matching your code for reference with the resulting behavior:

<!DOCTYPE html>
<html>
<head>
    <title>Mapbox GL JS debug page</title>
    <meta charset='utf-8'>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <link rel='stylesheet' href='../dist/mapbox-gl.css' />
    <script src="https://npmcdn.com/@turf/turf@5.1.6/turf.min.js" type="text/javascript"></script>
    <style>
    body { margin: 0; padding: 0; }
    html, body, #map { height: 100%; }
</style>
</head>

<body>
    <div id='map'></div>

    <script src='../dist/mapbox-gl-dev.js'></script>
    <script src='../debug/access_token_generated.js'></script>
    <script>
    var map = window.map = new mapboxgl.Map({
        container: 'map',
        zoom: 12.5,
        center: [-77.01866, 38.888],
        style: 'mapbox://styles/mapbox/light-v9',
        hash: true
    });

    const line_coords = [[-74.0062, 40.71248], [-74.19368, 40.753], [-74.47309, 40.88793], [-74.70092, 40.89073], [-74.87617, 40.92403], [-75.07013, 40.92848], [-75.17533, 40.99008], [-75.27065, 40.99844], [-75.38792, 41.06838], [-75.62253, 41.08331], [-76.13249, 41.01029], [-76.32437, 41.02759], [-76.56773, 41.00349], [-76.77534, 41.01004], [-77.05401, 41.06939], [-77.49725, 41.03875], [-77.64459, 40.96815], [-77.77571, 40.95766], [-77.9277, 41.02421], [-78.09348, 40.96545], [-78.23318, 40.99662], [-78.57593, 41.12717], [-78.83693, 41.1563], [-79.07103, 41.17108], [-79.4697, 41.19766], [-79.69169, 41.17955], [-80.02843, 41.20252], [-80.47289, 41.18248], [-80.67513, 41.1492], [-80.87306, 41.13915], [-80.95211, 41.21692], [-81.13735, 41.24243], [-81.51955, 41.25775], [-81.99334, 41.3793], [-82.26887, 41.37101], [-82.64922, 41.32889], [-83.29174, 41.46232], [-83.60887, 41.58178], [-84.00918, 41.59858], [-84.50422, 41.60806], [-84.84494, 41.65998], [-85.05962, 41.747], [-85.32025, 41.74388], [-85.84047, 41.73299], [-86.36913, 41.73059], [-86.53325, 41.73966], [-86.7069, 41.67388], [-86.93682, 41.58468], [-87.16323, 41.57961], [-87.6913, 41.58315], [-88.21966, 41.48585], [-88.33771, 41.43861], [-88.46146, 41.37842], [-88.66099, 41.37573], [-88.86323, 41.36866], [-89.36238, 41.40001], [-89.5509, 41.38882], [-90.20952, 41.44095], [-90.55341, 41.44932], [-90.66918, 41.50296], [-90.67783, 41.60256], [-91.07677, 41.64419], [-91.37922, 41.66807], [-92.20708, 41.69604], [-92.79867, 41.69543], [-93.19384, 41.69609], [-93.50948, 41.66189], [-93.704, 41.65249], [-93.77697, 41.64494], [-93.81156, 41.59092], [-94.01417, 41.54016], [-94.21989, 41.49537], [-94.57619, 41.49687], [-95.00886, 41.49743], [-95.44008, 41.49867], [-95.58354, 41.49754], [-95.62614, 41.43357], [-95.8247, 41.24087], [-96.05896, 41.22245], [-96.21211, 41.1199], [-96.29182, 41.03614], [-96.40829, 40.95912], [-96.55941, 40.89412], [-96.7161, 40.8622], [-96.85698, 40.8217], [-97.17888, 40.82247], [-98.04477, 40.82207], [-98.36421, 40.82267], [-98.57649, 40.7663], [-99.06678, 40.6699], [-99.39036, 40.69048], [-99.68118, 40.71425], [-99.88157, 40.80098], [-100.33242, 40.99304], [-100.85617, 41.11802], [-101.38486, 41.10794], [-101.72587, 41.11527], [-102.06101, 41.05193], [-102.35673, 41.04921], [-102.57408, 41.1128], [-102.88943, 41.11567], [-103.32276, 41.20647], [-103.83185, 41.19217], [-104.22254, 41.15746], [-105.17646, 41.09696], [-105.31805, 41.1261], [-105.4241, 41.19018], [-105.45867, 41.2615], [-105.56986, 41.2916], [-105.80578, 41.37837], [-106.1148, 41.56222], [-106.40344, 41.70481], [-106.55106, 41.74558], [-106.76938, 41.74317], [-107.2591, 41.78181], [-107.84693, 41.70549], [-108.11096, 41.65492], [-108.50499, 41.64139], [-108.81719, 41.68858], [-109.42384, 41.5283], [-109.68968, 41.54266], [-109.92135, 41.54165], [-110.21014, 41.38738], [-110.55868, 41.29745], [-110.76205, 41.30182], [-110.93385, 41.26791], [-111.02117, 41.24702], [-111.13301, 41.17966], [-111.30287, 41.0476], [-111.39981, 40.99333], [-111.40973, 40.93715], [-111.38777, 40.84047], [-111.45366, 40.78991], [-111.47038, 40.75396], [-111.55131, 40.73264], [-111.70006, 40.74954], [-112.04417, 40.72358], [-112.24471, 40.71234], [-112.40672, 40.67732], [-112.76885, 40.75785], [-112.90001, 40.82279], [-113.03181, 40.75497], [-113.51957, 40.73224], [-114.03209, 40.74132], [-114.14109, 40.77513], [-114.52044, 41.05947], [-114.80332, 41.11289], [-115.26369, 41.08582], [-115.42371, 41.00104], [-115.59513, 40.94971], [-115.81445, 40.81879], [-115.95746, 40.72879], [-116.07671, 40.72502], [-116.32713, 40.64207], [-116.57118, 40.69267], [-116.78556, 40.62357], [-116.94062, 40.63279], [-117.00915, 40.69887], [-117.11498, 40.78121], [-117.20109, 40.84901], [-117.44659, 40.93298], [-117.55695, 40.99835], [-117.73116, 40.97961], [-117.91132, 40.8883], [-118.07276, 40.67782], [-118.21613, 40.62952], [-118.28004, 40.52197], [-118.35876, 40.28331], [-118.66845, 40.03421], [-118.84311, 39.90083], [-119.0518, 39.75829], [-119.23389, 39.61455], [-119.37692, 39.58994], [-119.57749, 39.54921], [-119.68604, 39.52028], [-119.79662, 39.53661], [-119.98897, 39.5134], [-120.03727, 39.37154], [-120.20846, 39.32311], [-120.55512, 39.31556], [-120.71962, 39.27015], [-120.81253, 39.20155], [-120.91814, 39.13906], [-120.97403, 39.04505], [-121.21861, 38.792], [-121.36651, 38.65531], [-121.44616, 38.64162], [-121.75107, 38.53031], [-122.21076, 38.16085], [-122.23339, 38.08342], [-122.30604, 37.99272], [-122.30938, 37.82504], [-122.41954, 37.77496]]

    const LINE_INDEX = 150;

    function projectX(x) {
        return x / 360 + 0.5;
    }

    function projectY(y) {
        var sin = Math.sin(y * Math.PI / 180);
        var y2 = 0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;
        return y2 < 0 ? 0 : y2 > 1 ? 1 : y2;
    }
    var line_coords_cut = line_coords.slice().splice(LINE_INDEX, line_coords.length - 1);

    const l0 = turf.lineString(line_coords_cut);
    const l1 = turf.lineString(line_coords);
    var length0 = turf.length(l0, {units: 'meters'});
    var length1 = turf.length(l1, {units: 'meters'});

    let d0 = 0, d1 = 0;
    for (let i = 0; i < l0.geometry.coordinates.length - 1; ++i) {
        var from = (l0.geometry.coordinates[i]);
        var to = (l0.geometry.coordinates[i+1]);
        const d = [projectX(to[0]) - projectX(from[0]), projectY(to[1]) - projectY(from[1])];
        d0 += Math.sqrt(d[0] * d[0] + d[1] * d[1]);
    }
    for (let i = 0; i < l1.geometry.coordinates.length - 1; ++i) {
        var from = (l1.geometry.coordinates[i]);
        var to = (l1.geometry.coordinates[i+1]);
        const d = [projectX(to[0]) - projectX(from[0]), projectY(to[1]) - projectY(from[1])];
        d1 += Math.sqrt(d[0] * d[0] + d[1] * d[1]);
    }

    const gj0 = {
        "type": "FeatureCollection",
        "features": [{
            "type": "Feature",
            "properties": {},
            "geometry": {
                "coordinates": line_coords,
                "type": "LineString"
            }
        }]
    };

    const gj1 = {
        "type": "FeatureCollection",
        "features": [{
            "type": "Feature",
            "properties": {},
            "geometry": {
                "coordinates": line_coords_cut,
                "type": "LineString"
            }
        }]
    };

    map.on('load', () => {
        map.addSource('points', {
            'type': 'geojson',
            'data': {
                'type': 'FeatureCollection',
                'features': [{
                    // feature for Mapbox DC
                    'type': 'Feature',
                    'geometry': {
                        'type': 'Point',
                        'coordinates': line_coords[LINE_INDEX]
                    },
                }]
            }
        });

        map.addLayer({
            'id': 'points',
            'type': 'circle',
            'source': 'points',
            'paint': {
                'circle-radius': 10,
                'circle-color': '#3887be'
            }
        });
        map.showTileBoundaries = true;

        map.addSource('line0', {
            type: 'geojson',
            lineMetrics: true,
            data: gj0
        });

        map.addSource('line1', {
            type: 'geojson',
            lineMetrics: true,
            data: gj1
        });
        map.addLayer({
            type: 'line',
            source: 'line1',
            id: 'line1',
            paint: {
                'line-color': 'rgba(255, 0, 0, 1.0)',
                'line-width': 12
            }
        });
        map.addLayer({
            type: 'line',
            source: 'line0',
            id: 'line0',
            paint: {
                'line-color': 'blue',
                'line-width': 8,
                'line-gradient': [
                    'step',
                    ['line-progress'],
                    "green",
                    1.0 - d0 / d1, "yellow"
                ]
            }
        });
    });

</script>
</body>
</html>

Zoom 3:
screenshot1

Zoom 18:
screenshot2

Using the turf function with your method, where the location does not match and the error is clearly visible:
screenshot8

I don't believe there are any further change required in mapbox-gl to fit this case so I'll go ahead and close this ticket but feel free to continue the discussion if you need help or notice anything wrong with the suggestions above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else)
Projects
None yet
Development

No branches or pull requests

4 participants