Use different messages for crossing tunnels and bridges if they are connectable

This commit is contained in:
Quincy Morgan
2019-01-29 14:30:42 -05:00
parent ccfba8ba0d
commit fedad280b4
3 changed files with 20 additions and 1 deletions

View File

@@ -1192,8 +1192,12 @@ en:
tip: Crossing waterways should be connected or use tunnels.
tunnel-tunnel:
tip: Crossing tunnels should use different layers.
tunnel-tunnel_connectable:
tip: Crossing tunnels should be connected or use different layers.
bridge-bridge:
tip: Crossing bridges should use different layers.
bridge-bridge_connectable:
tip: Crossing bridges should be connected or use different layers.
highway_almost_junction:
message: "{highway} is very close but not connected to {highway2}."
tip: Intersecting highways should share a junction vertex.

View File

@@ -1454,8 +1454,14 @@
"tunnel-tunnel": {
"tip": "Crossing tunnels should use different layers."
},
"tunnel-tunnel_connectable": {
"tip": "Crossing tunnels should be connected or use different layers."
},
"bridge-bridge": {
"tip": "Crossing bridges should use different layers."
},
"bridge-bridge_connectable": {
"tip": "Crossing bridges should be connected or use different layers."
}
},
"highway_almost_junction": {

View File

@@ -283,12 +283,21 @@ export function validationHighwayCrossingOtherWays(context) {
entities = _map(entities, function(way) {
return getFeatureWithFeatureTypeTagsForWay(way, graph);
});
var canConnect = canConnectEntities(entities[0], entities[1]);
var crossingTypeID;
if (hasTag(entities[0].tags, 'tunnel') && hasTag(entities[1].tags, 'tunnel')) {
crossingTypeID = 'tunnel-tunnel';
if (canConnect) {
crossingTypeID += '_connectable';
}
}
else if (hasTag(entities[0].tags, 'bridge') && hasTag(entities[1].tags, 'bridge')) {
crossingTypeID = 'bridge-bridge';
if (canConnect) {
crossingTypeID += '_connectable';
}
}
else {
crossingTypeID = crossing.featureTypes.sort().join('-');
@@ -300,7 +309,7 @@ export function validationHighwayCrossingOtherWays(context) {
};
var fixes = [];
if (canConnectEntities(entities[0], entities[1])) {
if (canConnect) {
fixes.push(new validationIssueFix({
title: t('issues.fix.add_connection_vertex.title'),
onClick: function() {