I want to tweak dc.leaflet.js so that the rendering accepts an existing leaflet map object for the chart creation rather than creating a new one.
I am attempting this by trying to override the chart's render function to now include the generated map object. This works if I substitute _chart variable for the chart. At the moment I'm commenting out other variables such as _listeners and _legend to get it working. I'm not sure how to reference these as they are out of scope and they are not in the chart object. Any pointers on how to reference them?
whereChart.render = function () {
console.log(this);
//_listeners.preRender(_chart);
//if (whereChart._mandatoryAttributes)
// whereChart._mandatoryAttributes.forEach(checkForMandatoryAttributes);
var result = whereChart._doRender(mapObject);
//if (_legend) _legend.render();
whereChart._activateRenderlets("postRender");
return result;
};