Changes between Version 1 and Version 2 of Help/Styles/MapCSSImplementation


Ignore:
Timestamp:
2011-02-15T00:08:23+01:00 (15 years ago)
Author:
bastiK
Comment:

add eval

Legend:

Unmodified
Added
Removed
Modified
  • Help/Styles/MapCSSImplementation

    v1 v2  
    282282 * integer or floating point (in simple form e.g. 0.3). In general can be negative, but most properties do not support negative numbers
    283283 * has a special meaning if you put a "+" sign in front (relative width)
     284
     285== Eval expressions ==
     286See [http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java source] for details and an up to date list.
     287 +, -, *, /::
     288  arithmetic operations
     289 ||, &&, !::
     290  boolean operations
     291 <, >, <=, >=, ==::
     292  comparison operators
     293 asin, atan, atan2, ceil, cos, cosh, exp, floor, log, max, min, random, round, signum, sin, sinh, sqrt, tan, tanh::
     294  the usual meaning, [http://download.oracle.com/javase/6/docs/api/java/lang/Math.html details]
     295 cond(b, fst, snd)::
     296 b ? fst : snd::
     297  if ('''b''') then '''fst''' else '''snd'''
     298 list(a, b, ...)::
     299  create list of values, e.g. for the {{{dashes}}} property
     300 prop(''p_name'')::
     301  value of the property ''p_name'', e.g. prop({{{"width"}}})
     302 prop(''p_name'', ''layer_name'')::
     303  property from the layer ''layer_name''
     304 is_prop_set(''p_name'')::
     305  true, if property ''p_name'' is set
     306 is_prop_set(''p_name'', ''layer_name'')::
     307  true, if property ''p_name'' is set
     308 get_tag_value(''key_name'')::
     309  get the value of the key ''key_name'' from the object in question
     310 has_tag_key(''key_name'')::
     311  true, if the object has a tag with the given key
     312 rgb(''r'', ''g'', ''b'')::
     313  create color value (arguments from 0.0 to 1.0)
     314{{{#!comment
     315 red(''clr''), blue(''clr''), blue(''clr'')::
     316  get value of color channels in rgb color model
     317}}}
     318 JOSM_search("...")::
     319  true, if JOSM search applies to the object
     320{{{#!comment: untested
     321 JOSM_pref(''key'', ''default'')
     322  get JOSM preference
     323 JOSM_pref_color(''key'', ''default'')
     324  get color from JOSM preference
     325}}}