Skip to content

Commit

Permalink
Merge pull request #334 from JabLuszko/patch-3
Browse files Browse the repository at this point in the history
Fix routes showing as straight lines on new async raw.
  • Loading branch information
wraythex authored Apr 5, 2024
2 parents 4618272 + b49968b commit 1f67b6c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions static/js/map/map.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ function setupRoutePath(route) {

const wp = JSON.parse(route.waypoints)
for (let i = 0; i < wp.length; i++) {
if (!wp[i].lat_degrees || !wp[i].lng_degrees) {
let wp_lat = wp[i].lat_degrees ? wp[i].lat_degrees : wp[i].latDegrees
let wp_lng = wp[i].lng_degrees ? wp[i].lng_degrees : wp[i].lngDegrees
if (!wp_lat || !wp_lng) {
console.log('Unknown route waypoint: ', JSON.stringify(wp[i]))
continue
}
pointLL = new L.latLng(wp[i].lat_degrees, wp[i].lng_degrees)
pointLL = new L.latLng(wp_lat, wp_lng)
routePoints.push(pointLL)
}
pointLL = new L.latLng(route.end_poi_latitude, route.end_poi_longitude)
Expand Down

0 comments on commit 1f67b6c

Please sign in to comment.