Skip to content

Commit

Permalink
Implement contextclick and dblclick for canvas paths, fixes Leaflet#3481
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanSanchez committed May 20, 2015
1 parent 6feb4ab commit 3cec7fc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/layer/vector/canvas/Path.Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,14 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path :

_initEvents: function () {
if (this.options.clickable) {
// TODO dblclick
this._map.on('mousemove', this._onMouseMove, this);
this._map.on('click', this._onClick, this);
this._map.on('click dblclick contextmenu', this._fireMouseEvent, this);
}
},

_onClick: function (e) {
_fireMouseEvent: function (e) {
if (this._containsPoint(e.layerPoint)) {
this.fire('click', e);
this.fire(e.type, e);
}
},

Expand Down

0 comments on commit 3cec7fc

Please sign in to comment.