The DSV library that csv2geojson.js uses some "build-in" functions that aren't supported in IE8, namely map
function. Other parts of the code uses forEach
. I pulled up the following snippet from the DSV code:
function dsv(delimiter) {
var dsv = {},
reFormat = new RegExp("[\"" + delimiter + "\n]"),
delimiterCode = delimiter.charCodeAt(0);
dsv.parse = function(text, f) {
var o;
return dsv.parseRows(text, function(row, i) {
if (o) return o(row, i - 1);
var a = new Function("d", "return {" + row.map(function(name, i) {
return JSON.stringify(name) + ": d[" + i + "]";
}).join(",") + "}");
o = f ? function(row, i) { return f(a(row), i); } : a;
});
};
...
The .map
and .forEach
Array functions are implemented only in JavaScript 1.6 (ECMAScript 5) and higher. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map#Browser_compatibility .
Long story short, if you want it to work in IE, your code will only work in IE9 or higher. Other options is to rewrite DSV library to be compatible.