Remove static members from Snap
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user