Skip to content

Instantly share code, notes, and snippets.

@rdaly1490
rdaly1490 / LeafletCustomControl.js
Created February 9, 2016 21:09
Custom control class for Leaflet. Helps avoid issue where double clicking on a control button causes the map to zoom
class customControl extends L.Control {
constructor(options) {
super(options);
this.options = {
position: 'topright',
};
L.Util.setOptions(this, options);
}
onAdd() {
const container = L.DomUtil.create('div', 'leaflet-bar leaflet-control leaflet-control-custom');

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post