mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-03 09:53:40 +00:00
disable merge operation if at least one relation is incomplete
Incomplete multipolygons were harmed in the merge operation (which relies on completely loaded relations to determine inner/outer status for example). This disables the operation and adds an appropriate tooltip.
This commit is contained in:
@@ -106,6 +106,7 @@ en:
|
||||
not_eligible: These features can't be merged.
|
||||
not_adjacent: These lines can't be merged because they aren't connected.
|
||||
restriction: These lines can't be merged because at least one is a member of a "{relation}" relation.
|
||||
incomplete_relation: These features can't be merged because at least one hasn't been fully downloaded.
|
||||
move:
|
||||
title: Move
|
||||
description: Move this to a different location.
|
||||
|
||||
3
dist/locales/en.json
vendored
3
dist/locales/en.json
vendored
@@ -134,7 +134,8 @@
|
||||
"annotation": "Merged {n} lines.",
|
||||
"not_eligible": "These features can't be merged.",
|
||||
"not_adjacent": "These lines can't be merged because they aren't connected.",
|
||||
"restriction": "These lines can't be merged because at least one is a member of a \"{relation}\" relation."
|
||||
"restriction": "These lines can't be merged because at least one is a member of a \"{relation}\" relation.",
|
||||
"incomplete_relation": "These features can't be merged because at least one hasn't been fully downloaded."
|
||||
},
|
||||
"move": {
|
||||
"title": "Move",
|
||||
|
||||
@@ -108,6 +108,10 @@ iD.actions.MergePolygon = function(ids, newRelationId) {
|
||||
if (entities.other.length > 0 ||
|
||||
entities.closedWay.length + entities.multipolygon.length < 2)
|
||||
return 'not_eligible';
|
||||
if (!entities.multipolygon.every(function(r) {
|
||||
return r.isComplete(graph);
|
||||
}))
|
||||
return 'incomplete_relation';
|
||||
};
|
||||
|
||||
return action;
|
||||
|
||||
@@ -38,6 +38,9 @@ iD.operations.Merge = function(selectedIDs, context) {
|
||||
if (j === 'restriction' && m && p)
|
||||
return t('operations.merge.restriction', {relation: context.presets().item('type/restriction').name()});
|
||||
|
||||
if (p === 'incomplete_relation' && j && m)
|
||||
return t('operations.merge.incomplete_relation');
|
||||
|
||||
if (j && m && p)
|
||||
return t('operations.merge.' + j);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user