Skip to content

Commit

Permalink
Added editable:vertex:mouseover and editable:vertex:mouseout events
Browse files Browse the repository at this point in the history
  • Loading branch information
Git-Lior authored and yohanboniface committed Jul 12, 2018
1 parent dfd6d87 commit db8825d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Leaflet.Editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@
this.on('click', this.onClick);
this.on('contextmenu', this.onContextMenu);
this.on('mousedown touchstart', this.onMouseDown);
this.on('mouseover', this.onMouseOver);
this.on('mouseout', this.onMouseOut);
this.addMiddleMarkers();
},

Expand All @@ -500,6 +502,8 @@
this.off('click', this.onClick);
this.off('contextmenu', this.onContextMenu);
this.off('mousedown touchstart', this.onMouseDown);
this.off('mouseover', this.onMouseOver);
this.off('mouseout', this.onMouseOut);
L.Marker.prototype.onRemove.call(this, map);
},

Expand Down Expand Up @@ -547,6 +551,16 @@
this.editor.onVertexMarkerMouseDown(e);
},

onMouseOver: function (e) {
e.vertex = this;
this.editor.onVertexMarkerMouseOver(e);
},

onMouseOut: function (e) {
e.vertex = this;
this.editor.onVertexMarkerMouseOut(e);
},

// 🍂method delete()
// Delete a vertex and the related LatLng.
delete: function () {
Expand Down Expand Up @@ -1167,6 +1181,22 @@
this.fireAndForward('editable:vertex:mousedown', e);
},

onVertexMarkerMouseOver: function (e) {
// 🍂namespace Editable
// 🍂section Vertex events
// 🍂event editable:vertex:mouseover: VertexEvent
// Fired when a user's mouse enters the vertex
this.fireAndForward('editable:vertex:mouseover', e);
},

onVertexMarkerMouseOut: function (e) {
// 🍂namespace Editable
// 🍂section Vertex events
// 🍂event editable:vertex:mouseout: VertexEvent
// Fired when a user's mouse leaves the vertex
this.fireAndForward('editable:vertex:mouseout', e);
},

onMiddleMarkerMouseDown: function (e) {
// 🍂namespace Editable
// 🍂section MiddleMarker events
Expand Down

0 comments on commit db8825d

Please sign in to comment.