add Point equals method

This commit is contained in:
Vladimir Agafonkin 2012-11-14 14:07:17 +02:00
parent 34812d87c9
commit b3826358d5

View File

@ -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) + ', ' +