Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:help:v2:maps:on-demand-create [2025/05/14 15:31] – [WMTS and custom projection server] psyberiaen:help:v2:maps:on-demand-create [2025/11/07 14:31] (current) – [User input parameters] psyberia
Line 230: Line 230:
 <projection-code>EPSG:4326</projection-code> <projection-code>EPSG:4326</projection-code>
 <projection-true-origin-x>-125.0</projection-true-origin-x> <projection-true-origin-x>-125.0</projection-true-origin-x>
-<projection-true-origin-y>15.0</projection-true-origin-x></code>+<projection-true-origin-y>15.0</projection-true-origin-y></code>
     * By using the ''**<projection-name>**'' and ''**<projection-geoid>**'' tags to specify the name of a map projection. In this case too, the ''**<projection-true-origin-x>**'' and ''**<projection-true-origin-y>**'' tags are taken into account. Exemple: \\ <code><projection-name>mercator</projection-name>     * By using the ''**<projection-name>**'' and ''**<projection-geoid>**'' tags to specify the name of a map projection. In this case too, the ''**<projection-true-origin-x>**'' and ''**<projection-true-origin-y>**'' tags are taken into account. Exemple: \\ <code><projection-name>mercator</projection-name>
 <projection-geoid>WGS 84</projection-geoid></code> <projection-geoid>WGS 84</projection-geoid></code>
Line 247: Line 247:
 ===== Advanced features ===== ===== Advanced features =====
  
-==== Custom variables ====+==== Custom expressions ====
 \\ \\
 In addition to the variables provided by default, you can create your own variables defined by mathematical expressions: In addition to the variables provided by default, you can create your own variables defined by mathematical expressions:
Line 253: Line 253:
 <code xml> <code xml>
   <source id="MAP_UID">   <source id="MAP_UID">
-    <name>Custom Variables Map Example</name>+    <name>Custom Expressions Map Example</name>
     <zoom-levels z="1-17">     <zoom-levels z="1-17">
       <expression set="my_variable" type="int">iif( z>10, x*y, x+y )</expression>       <expression set="my_variable" type="int">iif( z>10, x*y, x+y )</expression>
Line 268: Line 268:
  
 [[en:help:v2:maps:on-demand-create#inline_expressions|See here for more details on available operators and functions.]] [[en:help:v2:maps:on-demand-create#inline_expressions|See here for more details on available operators and functions.]]
 +
 +\\
 +
 +==== User input parameters ====
 +\\
 +
 +You can request some parameters input to the user. When the map is displayed, the user has the ability to set all th parameters available according to his needs.
 +
 +To request a single choice parameter, use this tag:
 +
 +<code xml>
 +<variable set="param1" type="single" values="red,green" choices="Red color,Green color" default="red" display="Choose a color" />
 +</code>
 +
 +The ''"**set**"'' attribute defines the name of the variable that can be then used in custom expressions. The ''"**values**"'' attribute lists all the possible values the variable can have. The optional ''"**choices**"'' attribute lists the same values but for user display. The ''"**default**"'' attribute gives the default value to the variable (for example used to generate the map preview). The optional ''"**display**"'' attribute gives the title of this input to the user.
 +
 +To request a multiple choices parameter, use this tag:
 +<code xml>
 +<variable set="param2" type="multi" values="caves,mines" choices="Show caves,Show mines" default="caves,mines" join="," none="none" display="What to display" />
 +</code>
 +
 +The ''"**join**"'' attribute defines what to use to join the multiple choices into the variable. The optional ''"**none**"'' attribute defines what to set to the variable when no choices are selected.
  
 \\ \\
Line 349: Line 371:
  
 ===== Appendices ===== ===== Appendices =====
 +
 +\\
 +
 +==== Supported map projections ====
 +
 +^ EPSG Code  ^ Names  ^
 +| 1024  | Popular Visualisation Pseudo Mercator, Mercator Auxiliary Sphere  |
 +| 1026  | Mercator Spherical  |
 +| 1028  | Equidistant Cylindrical, Equirectangular  |
 +| 1029  | Equidistant Cylindrical (Spherical)  |
 +| 9801  | Lambert Conic Conformal (1SP)  |
 +| 9802  | Lambert Conic Conformal (2SP)  |
 +| 9803  | Lambert Conic Conformal (2SP Belgium)  |
 +| 9804  | Mercator (1SP), Mercator (Variant A)  |
 +| 9805  | Mercator (2SP), Mercator (Variant B)  |
 +| 9806  | Cassini Soldner  |
 +| 9807  | Transverse Mercator, Gauss Boaga, Gass Kruger  |
 +| 9808  | Transverse Mercator (South Orientated)  |
 +| 9809  | Stereographic, Oblique Stereographic, Double Stereographic, Roussilhe  |
 +| 9810  | Polar Stereographic (Variant A)  |
 +| 9812  | Hotine Oblique Mercator, Hotine Oblique Mercator (Variant A)  |
 +| 9815  | Oblique Mercator, Hotine Oblique Mercator (Variant B), Hotine Oblique Mercator Azimuth Center  |
 +| 9817  | Lambert Conic Near Conformal  |
 +| 9823  | C.f. 1029  |
 +| 9825  | Pseudo Plate Carree  |
 +| 9826  | Lambert Conic Conformal (West Orientated)  |
 +| 9827  | Bonne  |
 +| 9828  | Bonne (South Orientated)  |
 +| 9829  | Polar Stereographic (Variant B)  |
 +| 9842  | C.f. 1028  |
 +
 +\\
  
 ==== Inline expressions ==== ==== Inline expressions ====
Line 364: Line 418:
 |  ''**^**''  | Power operator.  | |  ''**^**''  | Power operator.  |
 |  ''**==**''  | Equal to operator (also used for string).  | |  ''**==**''  | Equal to operator (also used for string).  |
-|  ''**!=**'' <sup>1</sup>  | Not equal to operator (also used for string).  |+|  ''**!=**''  | Not equal to operator (also used for string).  |
 |  ''**>**''  | Greater than operator.  | |  ''**>**''  | Greater than operator.  |
 |  ''**> =**''  | Greater than or equal to operator.  | |  ''**> =**''  | Greater than or equal to operator.  |
Line 374: Line 428:
 |  ''**< <**''  | Signed left shift operator.  | |  ''**< <**''  | Signed left shift operator.  |
 |  ''**> >**''  | Signed right shift operator.  | |  ''**> >**''  | Signed right shift operator.  |
-<sup>1. Available from AQ 2.2.8c</sup> 
  
  
Line 407: Line 460:
 | ''**hypot**(double,double)''  | ''double''  | Returns ''sqrt(x²+y²)'' without intermediate overflow or underflow.  | | ''**hypot**(double,double)''  | ''double''  | Returns ''sqrt(x²+y²)'' without intermediate overflow or underflow.  |
 | ''**iif**(double,mixed,mixed)''  | ''mixed''  | If the first parameter is different from ''0.0'', return the second parameter, else the third one.  | | ''**iif**(double,mixed,mixed)''  | ''mixed''  | If the first parameter is different from ''0.0'', return the second parameter, else the third one.  |
 +| ''**indexOf**(string,string)''  | ''long''  | Returns the position of the first occurrence of the second parameter inside the first parameter.  |
 +| ''**lastIndexOf**(string,string)''  | ''long''  | Returns the position of the last occurrence of the second parameter inside the first parameter.  |
 | ''**len**(string), **length**(string)''  | ''long''  | Returns the length of a string.  | | ''**len**(string), **length**(string)''  | ''long''  | Returns the length of a string.  |
 | ''**ln**(double)''  | ''double''  | Returns the natural logarithm (base ''e'') of a double value.  | | ''**ln**(double)''  | ''double''  | Returns the natural logarithm (base ''e'') of a double value.  |
 | ''**log**(double)''  | ''double''  | Returns the base 10 logarithm of a double value.  | | ''**log**(double)''  | ''double''  | Returns the base 10 logarithm of a double value.  |
 +| ''**lower**(string)''  | ''string''  | Returns parameter as lower case.  |
 | ''**md5**(string)''  | ''string''  | Returns the [[https://en.wikipedia.org/wiki/MD5|MD5 hash]] of the string parameter.  | | ''**md5**(string)''  | ''string''  | Returns the [[https://en.wikipedia.org/wiki/MD5|MD5 hash]] of the string parameter.  |
 | ''**not**(double)''  | ''long''  | If the parameter is different from ''0.0'', return ''0'', else return ''1'' | | ''**not**(double)''  | ''long''  | If the parameter is different from ''0.0'', return ''0'', else return ''1'' |
Line 419: Line 475:
 | ''**round**(double)''  | ''long''  | Returns the closest long to the argument, with ties rounding to positive infinity.  | | ''**round**(double)''  | ''long''  | Returns the closest long to the argument, with ties rounding to positive infinity.  |
 | ''**sha1**(string)''  | ''string''  | Returns the [[https://en.wikipedia.org/wiki/SHA-1|SHA-1 hash]] of the string parameter.  | | ''**sha1**(string)''  | ''string''  | Returns the [[https://en.wikipedia.org/wiki/SHA-1|SHA-1 hash]] of the string parameter.  |
-| ''**sin**(double)'' <sup>1</sup>  | ''double''  | Returns the trigonometric sine of an angle.  |+| ''**sin**(double)''  | ''double''  | Returns the trigonometric sine of an angle.  |
 | ''**sqrt**(double)''  | ''double''  | Returns the correctly rounded positive square root of a double value.  | | ''**sqrt**(double)''  | ''double''  | Returns the correctly rounded positive square root of a double value.  |
 | ''**substr**(string,long)''  | ''string''  | Returns a string that is a substring of the string given in the first parameter. The substring begins with the character at the index specified by the second parameter and extends to the end of the string.  | | ''**substr**(string,long)''  | ''string''  | Returns a string that is a substring of the string given in the first parameter. The substring begins with the character at the index specified by the second parameter and extends to the end of the string.  |
Line 430: Line 486:
 | ''**unixtime**()''  | ''long''  | Returns the current time in seconds.  | | ''**unixtime**()''  | ''long''  | Returns the current time in seconds.  |
 | ''**unixtime**(long)''  | ''long''  | If the parameter is ''1'', returns the current time in milliseconds, otherwise returns the current time in seconds.  | | ''**unixtime**(long)''  | ''long''  | If the parameter is ''1'', returns the current time in milliseconds, otherwise returns the current time in seconds.  |
 +| ''**upper**(string)''  | ''string''  | Returns parameter as upper case.  |
 | ''**valueAt**(long,mixed...)''  | ''mixed''  | Returns the value at the index (starting from zero after the first parameter) specified by the first parameter.  | | ''**valueAt**(long,mixed...)''  | ''mixed''  | Returns the value at the index (starting from zero after the first parameter) specified by the first parameter.  |
-<sup>1. Available from AQ 2.2.8c</sup> 
  
 \\ \\