Skip to content

Commit

Permalink
Add drawControl and drawControlTooltips options to L.Map. Fixes Leafl…
Browse files Browse the repository at this point in the history
…et.toolbar#17 and ensures that helpful tooltips are shown by default when using Leaflet.draw.
  • Loading branch information
justinmanley committed Feb 1, 2015
1 parent f40f84a commit 1d7a99b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/draw/DrawToolbar.js
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
L.DrawToolbar = {};
L.DrawToolbar = {};

/*
* Defaults added to map for convenience.
*/
L.Map.mergeOptions({
drawControlTooltips: true,
drawControl: false
});

L.Map.addInitHook(function () {
if (this.options.drawControl) {
this.drawControl = new L.DrawToolbar.Control();
this.addLayer(this.drawControl);
}
});

0 comments on commit 1d7a99b

Please sign in to comment.