function normalizeLongitudes(vertices, refLng) {
  refLng = refLng === undefined ? vertices[0][0] : refLng;
  for (const pt of vertices) {
    const deltaLng = pt[0] - refLng;
    if (deltaLng > 180) {
      pt[0] -= 360;
    } else if (deltaLng < -180) {
      pt[0] += 360;
    }
  }
}
// normalize longitudes w.r.t center (refLng), when not provided first vertex
normalize longitudes w.r.t center (refLng), when not provided first vertex
normalize longitudes w . r . t center ( refLng ) when not provided first vertex
function normalizeLongitudes(vertices, refLng) {
  refLng = refLng === undefined ? vertices[0][0] : refLng;
  for (const pt of vertices) {
    const deltaLng = pt[0] - refLng;
    if (deltaLng > 180) {
      pt[0] -= 360;
    } else if (deltaLng < -180) {
      pt[0] += 360;
    }
  }
}
function normalizeLongitudes ( vertices , refLng ) { refLng = refLng === undefined ? vertices [ 0 ] [ 0 ] : refLng ; for ( const pt of vertices ) { const deltaLng = pt [ 0 ] - refLng ; if ( deltaLng > 180 ) { pt [ 0 ] -= 360 ; } else if ( deltaLng < - 180 ) { pt [ 0 ] += 360 ; } } }
normalize longitudes w.r.t center (refLng), when not provided first vertex
normalize longitudes w . r . t center ( refLng ) when not provided first vertex