Skip to content

Commit

Permalink
Attach coordinates to events
Browse files Browse the repository at this point in the history
  • Loading branch information
varna committed Jul 25, 2018
1 parent 4ec7faf commit 238ecd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions lib/MeasureTool.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export default class MeasureTool {
this._mapClickEvent.remove();
this._mapZoomChangedEvent.remove();

let coordinates = this._geometry.nodes
this._geometry = new Geometry();
this._onRemoveOverlay();
this._setOverlay();
Expand All @@ -136,7 +137,8 @@ export default class MeasureTool {
lengthText: this.lengthText,
area: this.area,
areaText: this.areaText,
segments: this.segments
segments: this.segments,
coordinates,
}
});
}
Expand Down Expand Up @@ -727,7 +729,8 @@ export default class MeasureTool {
lengthText: this.lengthText,
area: this.area,
areaText: this.areaText,
segments: this.segments
segments: this.segments,
coordinates: this._geometry.nodes,
}
});
}
Expand Down Expand Up @@ -759,7 +762,8 @@ export default class MeasureTool {
lengthText: this.lengthText,
area: this.area,
areaText: this.areaText,
segments: this.segments
segments: this.segments,
coordinates: this._geometry.nodes,
}
};
if (this._lastMeasure && this._lastMeasure.result.lengthText === this.lengthText && this._lastMeasure.result.areaText === this.areaText) return;
Expand Down

0 comments on commit 238ecd5

Please sign in to comment.