Changes between Initial Version and Version 1 of Ticket #12053, comment 2


Ignore:
Timestamp:
2015-11-03T13:48:47+01:00 (10 years ago)
Author:
naoliv

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12053, comment 2

    initial v1  
    1 Can't it be done with MapCSS?
    2 
    3 {{{
    4 #!mapcss
    5 way["mtb:scale:uphill"][!incline] {
    6     throwWarning: tr("missing {0} tag in way", "{1.key}");
    7 }
    8 }}}
    9 
    10 You could also create more MTB-specific rules and include them in https://josm.openstreetmap.de/wiki/Rules, if you want.
    11 
    12 For example, you could also test for some wrong things:
    13 
    14 {{{
    15 #!mapcss
    16 way["mtb:scale:uphill"][highway][highway !~ /path|track/] {
    17     throwWarning: tr("{0} should be used only with highway=path or highway=track", "{0.key}");
    18 }
    19 
    20 way["mtb:scale"]["mtb:scale" !~ /^[0-6]{1}$/] {
    21     throwWarning: tr("{0} must be a value between ''0'' and ''6''", "{0.key}");
    22 }
    23 
    24 way["mtb:scale:uphill"]["mtb:scale:uphill" !~ /^[0-5]{1}$/] {
    25     throwWarning: tr("{0} must be a value between ''0'' and ''5''", "{0.key}");
    26 }
    27 
    28 way["mtb:scale:imba"]["mtb:scale:imba" !~ /^[0-4]{1}$/] {
    29     throwWarning: tr("{0} must be a value between ''0'' and ''4''", "{0.key}");
    30 }
    31 }}}
     1(the same message was sent twice...)