From d5ecd5d52d6b0c5096940b419e7e4ba5876fbb93 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sun, 26 Oct 2014 13:21:40 -0400 Subject: [PATCH] add deep equals to extent --- js/id/geo/extent.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/id/geo/extent.js b/js/id/geo/extent.js index b86d687b7..a32b5783c 100644 --- a/js/id/geo/extent.js +++ b/js/id/geo/extent.js @@ -14,6 +14,13 @@ iD.geo.Extent = function geoExtent(min, max) { iD.geo.Extent.prototype = new Array(2); _.extend(iD.geo.Extent.prototype, { + equals: function (obj) { + return this[0][0] === obj[0][0] && + this[0][1] === obj[0][1] && + this[1][0] === obj[1][0] && + this[1][1] === obj[1][1]; + }, + extend: function(obj) { if (!(obj instanceof iD.geo.Extent)) obj = new iD.geo.Extent(obj); return iD.geo.Extent([Math.min(obj[0][0], this[0][0]),