mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 08:17:30 +02:00
Improve area-closed logic. Fixes #237
This commit is contained in:
@@ -115,8 +115,16 @@ iD.Way.isClosed = function(d) {
|
||||
return (!d.nodes.length) || d.nodes[d.nodes.length - 1].id === d.nodes[0].id;
|
||||
};
|
||||
|
||||
// a way is an area if:
|
||||
//
|
||||
// - area=yes
|
||||
// - closed and
|
||||
// - doesn't have area=no
|
||||
// - doesn't have highway tag
|
||||
iD.Way.isArea = function(d) {
|
||||
return iD.Way.isClosed(d) || (d.tags.area && d.tags.area === 'yes');
|
||||
return (d.tags.area && d.tags.area === 'yes') ||
|
||||
(iD.Way.isClosed(d) &&
|
||||
(!d.tags.area || d.tags.area === 'no') && !d.tags.highway);
|
||||
};
|
||||
|
||||
iD.Relation = function(attrs) {
|
||||
|
||||
Reference in New Issue
Block a user