ui-leaflet
ui-leaflet copied to clipboard
Trying to decorate/extend ui-leaflet
Hi,
I created my own control which extends L.Control.Draw as follow:
L.Control.Draw.List = L.Control.Draw.extend({
//my code
});
And now I'm trying to make ui-leaflet recognize it.
Ideally, line 287, I would like to add my control to the others in the controlTypes
variable like so :
var controlTypes = {
draw : {},
fullscreen : {},
search: {},
custom: {},
minimap: {},
drawList: {
isPluginLoaded: function() {
if (!angular.isDefined(L.Control.Draw.List)) {
$log.error(errorHeader + ' Draw plugin is not loaded.');
return false;
}
return true;
},
checkValidParams: function(/* params */) {
return true;
},
createControl: function(params) {
return new L.Control.Draw.List(params);
}
}
}
But I don't want to modify the original ui-leaflet.js file for obvious reasons.
Can you help?! Thanks in advance =)