diff --git a/src/io/mapshaper-export.js b/src/io/mapshaper-export.js index 1184b2089..110ca13b5 100644 --- a/src/io/mapshaper-export.js +++ b/src/io/mapshaper-export.js @@ -78,10 +78,14 @@ internal.exportFileContent = function(dataset, opts) { }, dataset); // Adjust layer names, so they can be used as output file names - if (opts.file && outFmt != 'topojson') { + if (opts.file && ['topojson','svg'].indexOf(outFmt) == -1) { dataset.layers.forEach(function(lyr) { lyr.name = utils.getFileBase(opts.file); }); + } else if (opts.file && outFmt == 'svg' && dataset.layers.length > 1) { + dataset.layers.forEach(function(lyr) { + lyr.name = utils.getFileBase(opts.file) + '-' + lyr.name; + }); } internal.assignUniqueLayerNames(dataset.layers);