chelm/esri-d3

Remove the setTimeout

chelm opened this issue · 3 comments

there's a setTimeout call in d3Layer.js - totally absurd and annoying work around for a race condition. https://github.com/chelm/esri-d3/blob/master/d3Layer.js#L36

I think we can override the _setMap function and call the render method once the map is ready. I recently did that elsewhere and will add it here.

Is this for on layer loaded firing before the graphics exist? Or something else. If so, try "onUpdateEnd" rather than "onLoad"

Oh cool, I'll look right now. I do actually like using _setMap so its very much tied to the actual adding of the map itself. But even the fact that I know that _setMap exists is cheating since I've seen the actually JS API source code, non-minified.

using _setMap to call _load which calls _render and fires the onLoad event now. Much nicer so that client apps dont need to manually call _render

commit: 5a802f5