Last active
January 2, 2016 09:59
-
-
Save patrickarlt/8286710 to your computer and use it in GitHub Desktop.
Custom marker with override.
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
// Subclass marker | |
var CustomMarker = L.Marker.extend({ | |
// override the update function | |
update: function(){ | |
//call the original update method | |
L.Marker.prototype.update.call(this); | |
// fire the update event | |
this.fire("update"); | |
// return 'this' to make it chainable | |
return this; | |
} | |
}); | |
// use like a regular marker | |
var myMarker = new CustomMarker([45.51, -122.67]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment