add Point equals method
This commit is contained in:
parent
34812d87c9
commit
b3826358d5
@ -84,6 +84,11 @@ L.Point.prototype = {
|
|||||||
return Math.sqrt(x * x + y * y);
|
return Math.sqrt(x * x + y * y);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
equals: function (point) {
|
||||||
|
return point.x === this.x &&
|
||||||
|
point.y === this.y;
|
||||||
|
},
|
||||||
|
|
||||||
toString: function () {
|
toString: function () {
|
||||||
return 'Point(' +
|
return 'Point(' +
|
||||||
L.Util.formatNum(this.x) + ', ' +
|
L.Util.formatNum(this.x) + ', ' +
|
||||||
|
Loading…
Reference in New Issue
Block a user