| 1517 | | /* 6 - error reporting */ |
| 1518 | | /* 6.1 - report wrong value of maxspeed */ |
| 1519 | | way[maxspeed=~/^[0-9]+$/]::maxspeedlayer, |
| 1520 | | way[maxspeed=signals]::maxspeedlayer, |
| 1521 | | way[maxspeed=none]::maxspeedlayer, |
| 1522 | | way[maxspeed=~/^[0-9]+ mph$/]::maxspeedlayer, |
| 1523 | | way[maxspeed=~/^[0-9]+ km\/h$/]::maxspeedlayer, |
| 1524 | | way[maxspeed=~/^[0-9]+ knots$/]::maxspeedlayer, |
| 1525 | | way[maxspeed=~/^(BY|FR|RO|RS|RU):(urban|rural|motorway)/][setting("implicit")]::maxspeedlayer, |
| 1526 | | way[maxspeed=~/^(FR):(zone30)/][setting("implicit")]::maxspeedlayer, |
| 1527 | | way[maxspeed=~/^(RO|RS):(trunk)/][setting("implicit")]::maxspeedlayer, |
| 1528 | | way[maxspeed=~/^(BY|RS|RU):(living_street)/][setting("implicit")]::maxspeedlayer |
| | 1524 | /* 6 - display maxspeed values as text (text always in default layer) */ |
| | 1525 | way[setting("textdisplay")][maxspeed] |
| | 1526 | { |
| | 1527 | maxspeedvalues: tag(maxspeed); |
| | 1528 | set text_available; |
| | 1529 | } |
| | 1530 | way[setting("textdisplay")][maxspeed:forward] |
| | 1531 | { |
| | 1532 | maxspeedvalues: concat(prop(maxspeedvalues), " fw", tag("maxspeed:forward")); |
| | 1533 | set text_available; |
| | 1534 | } |
| | 1535 | way[setting("textdisplay")][maxspeed:backward] |
| | 1536 | { |
| | 1537 | maxspeedvalues: concat(prop(maxspeedvalues), " bw", tag("maxspeed:backward")); |
| | 1538 | set text_available; |
| | 1539 | } |
| | 1540 | |
| | 1541 | /* get rid of the text after "@" as it can be a long text while keeping mph and knots */ |
| | 1542 | way[setting("textdisplay")][maxspeed:conditional] |
| | 1543 | { |
| | 1544 | maxspeedvalues: concat(prop(maxspeedvalues), " c", get(split(" @", tag("maxspeed:conditional")), 0)); |
| | 1545 | set text_available; |
| | 1546 | } |
| | 1547 | way[setting("textdisplay")][maxspeed:forward:conditional] |
| | 1548 | { |
| | 1549 | maxspeedvalues: concat(prop(maxspeedvalues), " fwc", get(split(" @", tag("maxspeed:forward:conditional")), 0)); |
| | 1550 | set text_available; |
| | 1551 | } |
| | 1552 | way[setting("textdisplay")][maxspeed:backward:conditional] |
| | 1553 | { |
| | 1554 | maxspeedvalues: concat(prop(maxspeedvalues), " bwc", get(split(" @", tag("maxspeed:backward:conditional")), 0)); |
| | 1555 | set text_available; |
| | 1556 | } |
| | 1557 | |
| | 1558 | way[setting("textdisplay")][maxspeed:advisory] |
| | 1559 | { |
| | 1560 | maxspeedvalues: concat(prop(maxspeedvalues), " a", tag("maxspeed:advisory")); |
| | 1561 | set text_available; |
| | 1562 | } |
| | 1563 | way[setting("textdisplay")][maxspeed:advisory:forward] |
| | 1564 | { |
| | 1565 | maxspeedvalues: concat(prop(maxspeedvalues), " afw", tag("maxspeed:advisory:forward")); |
| | 1566 | set text_available; |
| | 1567 | } |
| | 1568 | way[setting("textdisplay")][maxspeed:advisory:backward] |
| | 1569 | { |
| | 1570 | maxspeedvalues: concat(prop(maxspeedvalues), " abw", tag("maxspeed:advisory:backward")); |
| | 1571 | set text_available; |
| | 1572 | } |
| | 1573 | |
| | 1574 | /* display "v" only for the values yes or other reasons (as the reason can be a long text), but not for value no */ |
| | 1575 | way[setting("textdisplay")][maxspeed:variable][maxspeed:variable!=no] |
| | 1576 | { |
| | 1577 | maxspeedvalues: concat(prop(maxspeedvalues), " v"); |
| | 1578 | set text_available; |
| | 1579 | } |
| | 1580 | way[setting("textdisplay")][maxspeed:variable:forward][maxspeed:variable:forward!=no] |
| | 1581 | { |
| | 1582 | maxspeedvalues: concat(prop(maxspeedvalues), " vfw"); |
| | 1583 | set text_available; |
| | 1584 | } |
| | 1585 | way[setting("textdisplay")][maxspeed:variable:backward][maxspeed:variable:backward!=no] |
| | 1586 | { |
| | 1587 | maxspeedvalues: concat(prop(maxspeedvalues), " vbw"); |
| | 1588 | set text_available; |
| | 1589 | } |
| | 1590 | |
| | 1591 | way|z18-[setting("textdisplay")].text_available |
| | 1592 | { |
| | 1593 | font-size: 13; |
| | 1594 | text-color: black; |
| | 1595 | text-halo-radius: 2; |
| | 1596 | text-halo-color: white; |
| | 1597 | text: prop(maxspeedvalues); |
| | 1598 | } |
| | 1599 | |
| | 1600 | |
| | 1601 | /*************************************/ |
| | 1602 | |
| | 1603 | /* 7 - error reporting (text always in default layer, overwrites text: prop(maxspeedvalues))*/ |
| | 1604 | /* 7.1 - report wrong value of maxspeed (knots has no style support but should not produce a warning anyway) */ |
| | 1605 | way[maxspeed=~/^[1-9][0-9]*( mph| knots)?$/], |
| | 1606 | way[maxspeed=signals], |
| | 1607 | way[maxspeed=none], |
| | 1608 | way[maxspeed=~/^(BY|FR|RO|RS|RU):(urban|rural|motorway)/][setting("implicit")], |
| | 1609 | way[maxspeed=~/^(FR):(zone30)/][setting("implicit")], |
| | 1610 | way[maxspeed=~/^(RO|RS):(trunk)/][setting("implicit")], |
| | 1611 | way[maxspeed=~/^(BY|RS|RU):(living_street)/][setting("implicit")] |
| 1532 | | way[maxspeed:forward=~/^[0-9]+$/]::maxspeedcasinglayer, |
| 1533 | | way[maxspeed:forward=signals]::maxspeedcasinglayer, |
| 1534 | | way[maxspeed:forward=none]::maxspeedcasinglayer, |
| 1535 | | way[maxspeed:forward=~/^[0-9]+ mph$/]::maxspeedcasinglayer, |
| 1536 | | way[maxspeed:forward=~/^[0-9]+ km\/h$/]::maxspeedcasinglayer, |
| 1537 | | way[maxspeed:forward=~/^[0-9]+ knots$/]::maxspeedcasinglayer, |
| 1538 | | way[maxspeed:forward=~/^(BY|FR|RO|RS|RU):(urban|rural|motorway)/][setting("implicit")]::maxspeedcasinglayer, |
| 1539 | | way[maxspeed:forward=~/^(FR):(zone30)/][setting("implicit")]::maxspeedcasinglayer, |
| 1540 | | way[maxspeed:forward=~/^(RO|RS):(trunk)/][setting("implicit")]::maxspeedcasinglayer, |
| 1541 | | way[maxspeed:forward=~/^(BY|RS|RU):(living_street)/][setting("implicit")]::maxspeedcasinglayer |
| | 1615 | way[maxspeed:forward=~/^[1-9][0-9]*( mph| knots)?$/], |
| | 1616 | way[maxspeed:forward=signals], |
| | 1617 | way[maxspeed:forward=none], |
| | 1618 | way[maxspeed:forward=~/^(BY|FR|RO|RS|RU):(urban|rural|motorway)/][setting("implicit")], |
| | 1619 | way[maxspeed:forward=~/^(FR):(zone30)/][setting("implicit")], |
| | 1620 | way[maxspeed:forward=~/^(RO|RS):(trunk)/][setting("implicit")], |
| | 1621 | way[maxspeed:forward=~/^(BY|RS|RU):(living_street)/][setting("implicit")] |
| 1545 | | way[maxspeed:backward=~/^[0-9]+$/]::maxspeedcasinglayer, |
| 1546 | | way[maxspeed:backward=signals]::maxspeedcasinglayer, |
| 1547 | | way[maxspeed:backward=none]::maxspeedcasinglayer, |
| 1548 | | way[maxspeed:backward=~/^[0-9]+ mph$/]::maxspeedcasinglayer, |
| 1549 | | way[maxspeed:backward=~/^[0-9]+ km\/h$/]::maxspeedcasinglayer, |
| 1550 | | way[maxspeed:backward=~/^[0-9]+ knots$/]::maxspeedcasinglayer, |
| 1551 | | way[maxspeed:backward=~/^(BY|FR|RO|RS|RU):(urban|rural|motorway)/][setting("implicit")]::maxspeedcasinglayer, |
| 1552 | | way[maxspeed:backward=~/^(FR):(zone30)/][setting("implicit")]::maxspeedcasinglayer, |
| 1553 | | way[maxspeed:backward=~/^(RO|RS):(trunk)/][setting("implicit")]::maxspeedcasinglayer, |
| 1554 | | way[maxspeed:backward=~/^(BY|RS|RU):(living_street)/][setting("implicit")]::maxspeedcasinglayer |
| | 1625 | way[maxspeed:backward=~/^[1-9][0-9]*( mph| knots)?$/], |
| | 1626 | way[maxspeed:backward=signals], |
| | 1627 | way[maxspeed:backward=none], |
| | 1628 | way[maxspeed:backward=~/^(BY|FR|RO|RS|RU):(urban|rural|motorway)/][setting("implicit")], |
| | 1629 | way[maxspeed:backward=~/^(FR):(zone30)/][setting("implicit")], |
| | 1630 | way[maxspeed:backward=~/^(RO|RS):(trunk)/][setting("implicit")], |
| | 1631 | way[maxspeed:backward=~/^(BY|RS|RU):(living_street)/][setting("implicit")] |
| 1573 | | casing-width: 1; |
| 1574 | | casing-color: yellow; |
| 1575 | | } |
| 1576 | | |
| 1577 | | /* 6.2 - report wrong value of maxspeed:conditional */ |
| 1578 | | way["maxspeed:conditional"=~/^[1-9][0-9]* knots @ /]::maxspeedlayer, |
| 1579 | | way["maxspeed:forward:conditional"=~/^[1-9][0-9]* knots @ /]::maxspeedcasinglayer, |
| 1580 | | way["maxspeed:backward:conditional"=~/^[1-9][0-9]* knots @ /]::maxspeedcasinglayer |
| 1581 | | { |
| 1582 | | set cond_knots; |
| 1583 | | } |
| 1584 | | |
| 1585 | | way["maxspeed:conditional"]!.cond_kmh!.cond_mph!.cond_knots::maxspeedlayer, |
| 1586 | | way["maxspeed:forward:conditional"]!.cond_forward_kmh!.cond_forward_mph!.cond_knots::maxspeedcasinglayer, |
| 1587 | | way["maxspeed:backward:conditional"]!.cond_backward_kmh!.cond_backward_mph!.cond_knots::maxspeedcasinglayer |
| | 1649 | left-casing-width: 1; |
| | 1650 | left-casing-color: yellow; |
| | 1651 | right-casing-width: 1; |
| | 1652 | right-casing-color: yellow; |
| | 1653 | major-z-index: 3; |
| | 1654 | } |
| | 1655 | |
| | 1656 | |
| | 1657 | /* 7.2 - report wrong value of maxspeed:conditional */ |
| | 1658 | way["maxspeed:conditional"=~/^(none|[1-9][0-9]*( mph| knots)?) @ /] |
| | 1659 | { |
| | 1660 | set correct_value_cond; |
| | 1661 | } |
| | 1662 | |
| | 1663 | way["maxspeed:forward:conditional"=~/^(none|[1-9][0-9]*( mph| knots)?) @ /] |
| | 1664 | { |
| | 1665 | set correct_value_forward_cond; |
| | 1666 | } |
| | 1667 | |
| | 1668 | |
| | 1669 | way["maxspeed:backward:conditional"=~/^(none|[1-9][0-9]*( mph| knots)?) @ /] |
| | 1670 | { |
| | 1671 | set correct_value_backward_cond; |
| | 1672 | } |
| | 1673 | |
| | 1674 | |
| | 1675 | way["maxspeed:conditional"]!.correct_value_cond, |
| | 1676 | way["maxspeed:forward:conditional"]!.correct_value_forward_cond, |
| | 1677 | way["maxspeed:backward:conditional"]!.correct_value_backward_cond |
| 1625 | | left-casing-opacity: 1; |
| 1626 | | right-casing-opacity: 1; |
| 1627 | | z-index: 1; |
| 1628 | | |
| 1629 | | } |
| 1630 | | |
| 1631 | | /* 6.4 - report if maxspeed direction is opposed to oneway direction */ |
| 1632 | | way["maxspeed:backward"][oneway?], /* in default layer to not hide the oneway arrows */ |
| 1633 | | way["maxspeed:forward"][oneway=-1] |
| | 1713 | major-z-index: 3; |
| | 1714 | |
| | 1715 | } |
| | 1716 | |
| | 1717 | /* 7.4 - report wrong value of maxspeed:advisory */ |
| | 1718 | way[maxspeed:advisory=~/^[1-9][0-9]*( mph| knots)?$/] |
| | 1719 | { |
| | 1720 | set correct_value_advisory; |
| | 1721 | } |
| | 1722 | way[maxspeed:advisory:forward=~/^[1-9][0-9]*( mph| knots)?$/] |
| | 1723 | { |
| | 1724 | set correct_value_advisory_forward; |
| | 1725 | } |
| | 1726 | way[maxspeed:advisory:backward=~/^[1-9][0-9]*( mph| knots)?$/] |
| | 1727 | { |
| | 1728 | set correct_value_advisory_backward; |
| | 1729 | } |
| | 1730 | |
| | 1731 | way["maxspeed:advisory"]!.correct_value_advisory, |
| | 1732 | way["maxspeed:advisory:forward"]!.correct_value_advisory_forward, |
| | 1733 | way["maxspeed:advisory:backward"]!.correct_value_advisory_backward |