Skip to content

Instantly share code, notes, and snippets.

@odoe
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odoe/569382c48d200920873c to your computer and use it in GitHub Desktop.
Save odoe/569382c48d200920873c to your computer and use it in GitHub Desktop.
Leaflet Control Template
L.Control.Sample = L.Control.extend({
options: {
// topright, topleft, bottomleft, bottomright
position: 'topright'
},
initialize: function (options) {
// constructor
},
onAdd: function (map) {
// happens after added to map
},
onRemove: function (map) {
// when removed
}
});
L.control.sample = function(id, options) {
return new L.Control.Sample(id, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment