The implementation of the widget is done with a recursive function for a couple of reasons, mainly to make it synchronous instead of asynchronous, but this has a drawback.
You can start by making remove the function from the loop, because javascript will declare 6000 functions
dojoArray.forEach(this._latlngObjs, lang.hitch(this, function (obj) {
this._addMarker(obj);
var position = this._getLatLng(obj);
if (position) {
bounds.extend(position);
validCount++;
panPosition = position;
} else {
logger.error(this.id + ": " + "Incorrect coordinates (" + this.checkAttrForDecimal(obj, this.latAttr) +
"," + this.checkAttrForDecimal(obj, this.lngAttr) + ")");
}
}));
the recursive function will remove the last from the list and call itself again. This cost a lot of space.