JasonSanford/leaflet-vector-layers — pull request #31 by chriserickson (2013-01-18 18:06:37+00:00)
Title: Added ILayer events to Layer.js

When I tried to use vector layers with the Layers Control or in a group layer, I got errors because the vector layers layer doesn't implement the ILayer interfaces onAdd/onRemove functions.

I was able to get it working with existing source by doing the following:

lvector.AGS.prototype.onAdd = function() {
this.setMap(window.map)
}
lvector.AGS.prototype.onRemove = function() {
this.setMap(null)
}

But thought it would be good to submit a pull request.

I've not built/tested this beyond my original code that added it to the prototype manually.