File tree 1 file changed +2
-5
lines changed
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -232,18 +232,15 @@ export function getItineraryBounds (itinerary) {
232
232
* Return a leaflet LatLngBounds object that encloses the given leg's geometry.
233
233
*/
234
234
export function getLegBounds ( leg ) {
235
- let coords = polyline
235
+ const coords = polyline
236
236
. toGeoJSON ( leg . legGeometry . points )
237
237
. coordinates . map ( c => [ c [ 1 ] , c [ 0 ] ] )
238
238
239
239
// in certain cases, there might be zero-length coordinates in the leg
240
240
// geometry. In these cases, build us an array of coordinates using the from
241
241
// and to data of the leg.
242
242
if ( coords . length === 0 ) {
243
- coords = [
244
- [ leg . from . lat , leg . from . lon ] ,
245
- [ leg . to . lat , leg . to . lon ]
246
- ]
243
+ coords . push ( [ leg . from . lat , leg . from . lon ] , [ leg . to . lat , leg . to . lon ] )
247
244
}
248
245
return latLngBounds ( coords )
249
246
}
You can’t perform that action at this time.
0 commit comments