function toLonLat(coordinate, projection) {
  const lonLat = transform(
    coordinate,
    projection !== undefined ? projection : 'EPSG:3857',
    'EPSG:4326',
  );
  const lon = lonLat[0];
  if (lon < -180 || lon > 180) {
    lonLat[0] = modulo(lon + 180, 360) - 180;
  }
  return lonLat;
}
Transforms a coordinate to longitude/latitude.
@param {import("./coordinate.js").Coordinate} coordinate Projected coordinate.
@param {ProjectionLike} [projection] Projection of the coordinate.
    The default is Web Mercator, i.e. 'EPSG:3857'.
@return {import("./coordinate.js").Coordinate} Coordinate as longitude and latitude, i.e. an array
    with longitude as 1st and latitude as 2nd element.
@api