mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 15:56:56 +02:00
Ensure isDegenerate can be called for all entities
This commit is contained in:
@@ -153,6 +153,9 @@ osmEntity.prototype = {
|
||||
return false;
|
||||
},
|
||||
|
||||
isDegenerate: function() {
|
||||
return true;
|
||||
},
|
||||
|
||||
deprecatedTags: function() {
|
||||
var tags = _.toPairs(this.tags);
|
||||
|
||||
@@ -36,6 +36,15 @@ _.extend(osmNode.prototype, {
|
||||
},
|
||||
|
||||
|
||||
isDegenerate: function() {
|
||||
return !(
|
||||
Array.isArray(this.loc) && this.loc.length === 2 &&
|
||||
this.loc[0] >= -180 && this.loc[0] <= 180 &&
|
||||
this.loc[1] >= -90 && this.loc[1] <= 90
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
isIntersection: function(resolver) {
|
||||
return resolver.transient(this, 'isIntersection', function() {
|
||||
return resolver.parentWays(this).filter(function(parent) {
|
||||
|
||||
Reference in New Issue
Block a user