Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
format: ExportFormat,
title: string,
projectionIn: string,
projectionOut: string
) {
const olFormat = new olformat[format]();
const featuresText = olFormat.writeFeatures(olFeatures, {
dataProjection: projectionOut,
featureProjection: projectionIn,
featureType: 'feature',
featureNS: 'http://example.com/feature'
});
const fileName = `${title}.${format.toLowerCase()}`;
downloadContent(featuresText, 'text/plain;charset=utf-8', fileName);
observer.complete();
}
export function exportToCSV(rows: any[][], fileName: string, separator: string = ';') {
const lines = rows.map((row: any[][], index: number) => row.join(separator));
const csvContent = lines.join('\n');
downloadContent(csvContent, 'text/csv;charset=utf-8', fileName);
}