CloudMade/Leaflet — pull request #994 by mdaines (2012-09-11 19:06:07+00:00)
Title: When removing tiles, set tile element src to the empty image URL only if the tile element is an image

When a tile is removed in TileLayer, its src attribute is set to L.Util.emptyImageUrl, but this doesn't make sense for subclasses, like TileLayer.Canvas. Also, _tileOnLoad currently checks the src attribute before adding the "leaflet-tile-loaded" class and firing a "tileload" event, which doesn't make sense for non-image tile layers. With the reuseTiles option on, this prevents the "leaflet-tile-loaded" class from being added to reused tiles.

This changes _removeTile and _tileOnLoad to only set or check the src attribute if the tile element is an IMG element.