Advanced track topics: Difference between revisions

From Maria GDK Wiki
Jump to navigation Jump to search
No edit summary
()
 
Line 17: Line 17:
</compositeitem>
</compositeitem>
</source>
</source>
Resolved property values within CustomSymbolizerParams are passed to custom symbol providers implementing [http://codedoc.maria.teleplanglobe.com/codedoc/html/170F3031.htm IRasterSymbolProvider] as ''customParameters'' to [http://codedoc.maria.teleplanglobe.com/codedoc/html/D85253BE.htm GetSymbol]
Resolved property values within CustomSymbolizerParams are passed to custom symbol providers implementing [http://codedocs.maria.teleplanglobe.com/release/managed/interface_t_p_g_1_1_geo_framework_1_1_symbols_1_1_contracts_1_1_providers_1_1_i_raster_symbol_provider.html IRasterSymbolProvider] as ''customParameters'' to [http://codedocs.maria.teleplanglobe.com/release/managed/interface_t_p_g_1_1_geo_framework_1_1_symbols_1_1_contracts_1_1_providers_1_1_i_raster_symbol_provider.html#a6634ced94bc4590bf79f8be38f746c50 GetSymbol]


== Display priorities ==
== Display priorities ==

Latest revision as of 16:19, 2 November 2020

Custom symbolizer parameters

Styling values assigned to tracks are assumed to remain constant. This allows very fast style caching and reuse of style elements between individual tracks. Two exceptions to this rule exists:

  • The symbol field "SymbolKeyField" references a track property that may be different between two tracks with the same styling
  • Within composite "CustomSymbolizerParams", the value part of a style item may reference the contents of a track field

Example:

<compositeitem name="CustomSymbolizerParams">
    <valueitem name="SomeColor" value="255,0,0,128"/>
    <!-- {<fieldname>} is used to reference value in track data.
         It is only expanded to track data within compositeitem 
         CustomSymbolizerParams due to styleitem caching considerations -->
    <valueitem name="MyParamName" value="{myfield}"/>
</compositeitem>

Resolved property values within CustomSymbolizerParams are passed to custom symbol providers implementing IRasterSymbolProvider as customParameters to GetSymbol

Display priorities

Track sybmols are assigned an initial, fixed display priority between 0.0 and 1.0. If the priority is adjusted for a group of tracks using the same value, their internal ordering will be unchanged. Using the style item "RelDispPri", the display priority can be adjusted.

<stylecategory name="TrackSymbol">
  <!-- ... -->
  <style>
    <statecondition key="Selected" scope="PerItem" state="Active"/>
    <valueitem name="RelDispPri" value="10.0"/>
  </style>
  <!-- ... -->
  <style>
    <fieldcondition field="cargoclass" value="hazardous"/>
    <valueitem name="RelDispPri" value="1.0" action="add"/>
  </style>
  <!-- ... -->
</stylecategory>

Using the above style setup, it is possible to combine display priorities in a very fine-grained manner. Consider track A and B, A has hazardous cargo, B does not. Basic display pri assigned by the system is A:0.2, B:0.6. If both are unselected, resulting disp pri is A:1.2, B:0.6, A on top. If B is selected, A:1.2, B:10.6, B on top. If both selected, A:11.2, B:10.6, A on top.

Note action="add" in the last valueitem. This causes any occurence of RelDispPri to be added to the existing value rather than just replacing it.