Changes between Version 42 and Version 43 of Help/Styles/MapCSSImplementation


Ignore:
Timestamp:
2014-03-06T21:47:05+01:00 (11 years ago)
Author:
bastiK
Comment:

update Expression functions

Legend:

Unmodified
Added
Removed
Modified
  • Help/Styles/MapCSSImplementation

    v42 v43  
    868868 rgb(''r'', ''g'', ''b'')::
    869869  create color value (arguments from 0.0 to 1.0)
     870 hsb_color(''h'', ''s'', ''b'')::
     871  create color from hue, saturation and brightness (arguments from 0.0 to 1.0) [''since 6877'']
    870872 red(''clr''), green(''clr''), blue(''clr'')::
    871873  get value of color channels in rgb color model
     
    876878 length(''lst'')::
    877879  length of a list [''since 5699'']
     880 coalesce(obj1, obj2, ...)::
     881  returns the first object which is not null [''since 6611'']
    878882 concat(''str1'', ''str2'', ...)::
    879883  assemble the strings to one
     884 join(''sep'', ''str1'', ''str2'', ...)::
     885  join strings, whith ''sep'' as separator [''since 6737'']
    880886 JOSM_search("...")::
    881887  true, if JOSM search applies to the object
     888 tr(str, arg0, arg1, ...)::
     889  translate from English to the current language (only for strings in the JOSM user interface) [''since 6506'']
    882890 regexp_test(regexp, string)::
    883891  test if ''string'' matches pattern ''regexp'' [''since 5699'']
     
    888896 regexp_match(regexp, string, flags)::
    889897  Tries to match ''string'' against pattern ''regexp''. Returns a list of capture groups in case of success. The first element (index 0) is the complete match (i.e. ''string''). Further elements correspond to the bracketed parts of the regular expression. Flags is a string that may contain "i" (case insensitive), "m" (multiline) and "s" ("dot all") [''since 5701'']
     898 substring(str, idx)::
     899  return the substring of ''str'', starting at index ''idx'' (0-indexed) [''since 6534'']
     900 substring(str, start, end)::
     901  return the substring of ''str'', starting at index ''start'' (inclusive) up to ''end'' (exclusive) (0-indexed) [''since 6534'']
    890902 replace(string, old, new)::
    891903   Replaces any occurrence of the substring ''old'' within the string ''string'' with the text ''new''
    892904 osm_id()::
    893905  returns the OSM id of the current object [''since 5699'']
     906 URL_encode(str)::
     907  [https://en.wikipedia.org/wiki/Percent-encoding percent-encode] a string. May be useful for data URLs [''since 6805'']
     908 XML_encode(str)::
     909  escape special characters in xml. E.g. {{{<}}} becomes {{{&lt;}}}, other special characters: {{{>}}}, {{{"}}}, {{{'}}}, {{{&}}}, {{{\n}}}, {{{\t}}} and {{{\r}}} [''since 6809'']
     910 CRC32_checksum(''str'')::
     911  calculate the CRC32 checksum of a string (result is an integer from 0 to 2^32^-1) [''since 6899'']
    894912{{{#!comment: untested
    895913 JOSM_pref(''key'', ''default'')