Created
December 12, 2012 10:58
-
-
Save mourner/4266919 to your computer and use it in GitHub Desktop.
New in Leaflet master: AOP-style constructor hooks for all classes. Example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L.Marker.addInitHook(function () { | |
// do some additional stuff in the constructor, e.g.: | |
this.on('click', doExcitingStuff); | |
// will be called for all instances of Marker | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment