Skip to content

Instantly share code, notes, and snippets.

@odoe

odoe/leaflet-control.js

Last active Aug 29, 2015
Embed
What would you like to do?
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