Remove static members from Snap

This commit is contained in:
Tim Schaub
2018-02-25 09:03:46 -07:00
parent e0a99c43dc
commit dfefe7d465
+6 -7
View File
@@ -120,7 +120,7 @@ const Snap = function(opt_options) {
* @type {function(ol.SnapSegmentDataType, ol.SnapSegmentDataType): number} * @type {function(ol.SnapSegmentDataType, ol.SnapSegmentDataType): number}
* @private * @private
*/ */
this.sortByDistance_ = Snap.sortByDistance.bind(this); this.sortByDistance_ = sortByDistance.bind(this);
/** /**
@@ -616,11 +616,10 @@ function handleUpEvent(evt) {
* @return {number} The difference in distance. * @return {number} The difference in distance.
* @this {ol.interaction.Snap} * @this {ol.interaction.Snap}
*/ */
Snap.sortByDistance = function(a, b) { function sortByDistance(a, b) {
return squaredDistanceToSegment( const deltaA = squaredDistanceToSegment(this.pixelCoordinate_, a.segment);
this.pixelCoordinate_, a.segment) - const deltaB = squaredDistanceToSegment(this.pixelCoordinate_, b.segment);
squaredDistanceToSegment( return deltaA - deltaB;
this.pixelCoordinate_, b.segment); }
};
export default Snap; export default Snap;