add addTo function to Handler (#5930)
This commit is contained in:
parent
b22ca31716
commit
30d7b8997d
@ -47,3 +47,11 @@ export var Handler = Class.extend({
|
||||
// @method removeHooks()
|
||||
// Called when the handler is disabled, should remove the event hooks added previously.
|
||||
});
|
||||
|
||||
// @section There is static function which can be called without instantiating L.Handler:
|
||||
// @function addTo(map: Map, name: String): this
|
||||
// Adds a new Handler to the given map with the given name.
|
||||
Handler.addTo = function (map, name) {
|
||||
map.addHandler(name, this);
|
||||
return this;
|
||||
};
|
||||
|
@ -682,7 +682,6 @@ export var Map = Evented.extend({
|
||||
this.fire('locationfound', data);
|
||||
},
|
||||
|
||||
// TODO handler.addTo
|
||||
// TODO Appropriate docs section?
|
||||
// @section Other Methods
|
||||
// @method addHandler(name: String, HandlerClass: Function): this
|
||||
|
Loading…
Reference in New Issue
Block a user