Calculates the bounding box for a route section.
This function computes a bbox by sampling coordinates from the section at three key points:
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
undefined
const section = route.properties.sections.countries[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.countries[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.
This function computes a bbox by sampling coordinates from the section at three key points: