Leaflet/Leaflet — pull request #2376 by mourner (2014-01-14 11:38:58+00:00)
Title: Split GridLayer into Grid (DOM-less) & GridLayer

Following @patrickarlt suggestions in #2344, I made a quick experiment in the `grid` branch, splitting the current `GridLayer` implementation (534 lines) into two classes — `Grid` (pure DOM-less grid logic with wrapping/bounding/etc, 299 lines) & `GridLayer` (handles DOM tiles, positioning, anim etc., 277 lines).

I'm not yet satisfied with how it looks because of too much super calls (`L.Grid.prototype.method.call(this, a, b)`) and a bit bulkier code overall (31 more sloc), but the direction might be promising, as it logically splits the huge `GridLayer` implementation in half, and the current 534 lines for one class is too much and looks pretty messy.

I'm sure @jfirebaugh won't like it though, he hates inheritance. :) I don't currently see a clean way to deal with `GridLayer` complexity without introducing another class in inheritance chain though. cc @tmcw