Skip to content
Browse files

Make Leaflet build again.

  • Loading branch information...
1 parent d7998fa commit e27f4cbcbddd0c303ee84ba618cb00c8c96826b2 Mattias Bengtsson committed
Showing with 10 additions and 7 deletions.
  1. +10 −7 src/layer/vector/Polyline.Edit.js
View
17 src/layer/vector/Polyline.Edit.js
@@ -139,13 +139,16 @@ L.Handler.PolyEdit = L.Handler.extend({
_createMiddleMarker: function (marker1, marker2) {
var latlng = this._getMiddleLatLng(marker1, marker2),
- marker = this._createMarker(latlng);
+ marker = this._createMarker(latlng),
+ onClick,
+ onDragStart,
+ onDragEnd;
marker.setOpacity(0.6);
marker1._middleRight = marker2._middleLeft = marker;
- function onDragStart() {
+ onDragStart = function () {
var i = marker2._index;
marker._index = i;
@@ -163,21 +166,21 @@ L.Handler.PolyEdit = L.Handler.extend({
marker2._index++;
this._updatePrevNext(marker1, marker);
this._updatePrevNext(marker, marker2);
- }
+ };
- function onDragEnd() {
+ onDragEnd = function () {
marker.off('dragstart', onDragStart, this);
marker.off('dragend', onDragEnd, this);
this._createMiddleMarker(marker1, marker);
this._createMiddleMarker(marker, marker2);
- }
+ };
- function onClick() {
+ onClick = function () {
onDragStart.call(this);
onDragEnd.call(this);
this._poly.fire('edit');
- }
+ };
marker
.on('click', onClick, this)

0 comments on commit e27f4cb

Please sign in to comment.
Something went wrong with that request. Please try again.