Skip to content

Commit

Permalink
🐛 Fix broken GeoJSON polylines
Browse files Browse the repository at this point in the history
  • Loading branch information
jheubuch committed Jan 17, 2025
1 parent 4d309f8 commit f1a16ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/DataProviders/Bahn.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,9 @@ private function getPolyLineFromTrip($journey, Collection $stopovers): PolyLine
$geoJson['features'][$closestFeatureKey]['properties'] = $properties;
}

// Make features to array again, if they get broken by the code above
$geoJson['features'] = array_values($geoJson['features']);

$geoJsonString = json_encode($geoJson);
$polyline = PolyLine::create([
'hash' => md5($geoJsonString),
Expand Down

0 comments on commit f1a16ec

Please sign in to comment.