Calculates the bounding box for a route section.
It samples the section's coordinates at three points:
startPointIndex
endPointIndex
The route containing the section.
The section to calculate the bbox for.
The bounding box as [minLng, minLat, maxLng, maxLat], or undefined if the section or route is invalid.
[minLng, minLat, maxLng, maxLat]
undefined
const section = route.properties.sections.country[0];// section = { id: 'section-1', startPointIndex: 0, endPointIndex: 3, countryCodeISO3: 'NLD' }const bbox = getSectionBBox(route, section);// Returns: [minLng, minLat, maxLng, maxLat] spanning the section, or undefined Copy
const section = route.properties.sections.country[0];// section = { id: 'section-1', startPointIndex: 0, endPointIndex: 3, countryCodeISO3: 'NLD' }const bbox = getSectionBBox(route, section);// Returns: [minLng, minLat, maxLng, maxLat] spanning the section, or undefined
Calculates the bounding box for a route section.
It samples the section's coordinates at three points:
startPointIndex.endPointIndex.