mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Add validation issue flagging ways with highway=road (close #5998)
This commit is contained in:
@@ -1298,6 +1298,10 @@ en:
|
||||
title: Lines Tagged as Areas
|
||||
message: '{feature} should be a closed area based on the tag "{tag}"'
|
||||
tip: "Areas must have connected endpoints."
|
||||
unknown_road:
|
||||
title: Unknown Roads
|
||||
message: "{feature} has no classification"
|
||||
tip: "Roads without a specific type may not appear in maps or routing."
|
||||
fix:
|
||||
connect_almost_junction:
|
||||
annotation: Connected very close features.
|
||||
@@ -1331,6 +1335,8 @@ en:
|
||||
title: Reposition the features
|
||||
select_preset:
|
||||
title: Select a feature type
|
||||
select_road_type:
|
||||
title: Select a road type
|
||||
set_as_inner:
|
||||
title: Set as inner
|
||||
set_as_outer:
|
||||
|
||||
@@ -152,8 +152,7 @@
|
||||
"highway/residential",
|
||||
"highway/living_street",
|
||||
"highway/service",
|
||||
"highway/track",
|
||||
"highway/road"
|
||||
"highway/track"
|
||||
]
|
||||
},
|
||||
"category-road_service": {
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
"highway/residential",
|
||||
"highway/living_street",
|
||||
"highway/service",
|
||||
"highway/track",
|
||||
"highway/road"
|
||||
"highway/track"
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+8
@@ -1598,6 +1598,11 @@
|
||||
"message": "{feature} should be a closed area based on the tag \"{tag}\"",
|
||||
"tip": "Areas must have connected endpoints."
|
||||
},
|
||||
"unknown_road": {
|
||||
"title": "Unknown Roads",
|
||||
"message": "{feature} has no classification",
|
||||
"tip": "Roads without a specific type may not appear in maps or routing."
|
||||
},
|
||||
"fix": {
|
||||
"connect_almost_junction": {
|
||||
"annotation": "Connected very close features."
|
||||
@@ -1645,6 +1650,9 @@
|
||||
"select_preset": {
|
||||
"title": "Select a feature type"
|
||||
},
|
||||
"select_road_type": {
|
||||
"title": "Select a road type"
|
||||
},
|
||||
"set_as_inner": {
|
||||
"title": "Set as inner"
|
||||
},
|
||||
|
||||
@@ -9,3 +9,4 @@ export { validationMissingTag } from './missing_tag';
|
||||
export { validationOldMultipolygon } from './old_multipolygon';
|
||||
export { validationOutdatedTags } from './outdated_tags';
|
||||
export { validationTagSuggestsArea } from './tag_suggests_area';
|
||||
export { validationUnknownRoad } from './unknown_road';
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
import { operationDelete } from '../operations/index';
|
||||
import { t } from '../util/locale';
|
||||
import { utilDisplayLabel } from '../util';
|
||||
import { validationIssue, validationIssueFix } from '../core/validator';
|
||||
|
||||
|
||||
export function validationUnknownRoad() {
|
||||
var type = 'unknown_road';
|
||||
|
||||
var validation = function(entity, context) {
|
||||
|
||||
if (entity.type !== 'way' || entity.tags.highway !== 'road') return [];
|
||||
|
||||
return [new validationIssue({
|
||||
type: type,
|
||||
severity: 'warning',
|
||||
message: t('issues.unknown_road.message', {
|
||||
feature: utilDisplayLabel(entity, context),
|
||||
}),
|
||||
tooltip: t('issues.unknown_road.tip'),
|
||||
entities: [entity],
|
||||
fixes: [
|
||||
new validationIssueFix({
|
||||
icon: 'iD-icon-search',
|
||||
title: t('issues.fix.select_road_type.title'),
|
||||
onClick: function() {
|
||||
context.ui().sidebar.showPresetList();
|
||||
}
|
||||
}),
|
||||
new validationIssueFix({
|
||||
icon: 'iD-operation-delete',
|
||||
title: t('issues.fix.delete_feature.title'),
|
||||
onClick: function() {
|
||||
var id = this.issue.entities[0].id;
|
||||
operationDelete([id], context)();
|
||||
}
|
||||
})
|
||||
]
|
||||
})];
|
||||
};
|
||||
|
||||
validation.type = type;
|
||||
|
||||
return validation;
|
||||
}
|
||||
Reference in New Issue
Block a user