seelmann/leaflet-providers — pull request #6 by jieter (2012-11-01 20:03:36+00:00)
Title: Fixing some issues and end up rewriting the whole thing in the process...

Don't know if you are still maintaining this plugin, and if you are interested in a refactoring, but while I was making some small changes to leaflet-providers, I was looking for a more readable way to record the definitions for each provider. This is what I came up with. The inheritance of attributions makes it a little more complicated and less readable.

I propose a little different syntax for constructing the provider tile layers:
```Javascript
var l = new L.TileLayer.Provider('Thunderforest');
var l = new L.TileLayer.Provider('Stamen.Lite');
```
But also, in compliance with Leaflet's idea of providing factory methods:
```Javascript
L.TileLayer.provider('Thunderforest');
L.TileLayer.provider('Stamen.Lite');
```

Factory method syntax:
```
L.TileLayer.provider('Stamen').addTo(map);
//instead of
(new L.TileLayer.Stamen).addTo(map);
```

The code currently exports every provided tile layer to the ```L.TileLayer.``` object as well, creating ```L.TileLayer.[.]```-constructors for each provided layer, but I don't think it's a good plan to include another extra syntax, but added it anyway to be backwards compatible.

Let me know what you think...