Use d3.geo.area

This commit is contained in:
John Firebaugh
2013-08-26 10:32:22 -07:00
parent 28d12a831b
commit 539a8520b4
+1 -9
View File
@@ -36,11 +36,6 @@ iD.Entity.key = function(entity) {
return entity.id + 'v' + (entity.v || 0);
};
iD.Entity.areaPath = d3.geo.path()
.projection(d3.geo.mercator()
.scale(12016420.517592335)
.precision(0));
iD.Entity.prototype = {
tags: {},
@@ -107,12 +102,9 @@ iD.Entity.prototype = {
resolver.parentRelations(this).length > 0;
},
// Returns the (possibly negative) area of the entity in square pixels at an
// arbitrary unspecified zoom level -- so basically, only useful for relative
// comparisons.
area: function(resolver) {
return resolver.transient(this, 'area', function() {
return iD.Entity.areaPath.area(this.asGeoJSON(resolver, true));
return d3.geo.area(this.asGeoJSON(resolver, true));
});
},