SvgMap

From Agility
(Redirected from SvgMap - FastNet Control)
Jump to: navigation, search


Dynamic Style & Tooltip

This functionality allows to customize style and tooltip for each item on map. It is defined by two string expressions:

  • Conditional Item Style
  • Conditional Item Tooltip

Svgmap options.png


String expressions are evaluated for each item on map. Each expression is using Conditional Item Table Name during evaluation as base table. If Conditional Item Table is child table than all expressions will be evaluated for each child. Results will be applied to item when any child item returns not null value.

Result of conditional style is appended to item definition as class name:

if(pmAsset.TempCode="SITE", "svgmap-item-site", 
    if(pmAsset.TempCode="LOCATION", "svgmap-item-location",
        if(pmAsset.TempCode="SUBLOCATION", "svgmap-item-sublocation", "svgmap-item-asset"))) Attrib(LookupCacheAllow=false)

In above example output class depend from asset template.

SvgMap classes are stored in predefined css file: Web\svg\svgmap_style.css. Currently SvgMap style classes can’t be overridden by tweaking custom user profile (in database). It is possible however to apply inline style instead predefined class name. To append inline style string expression should be extended by Attrib element:

if(pmAsset.TempCode="SUBLOCATION”, "fill: #0000ff !important; fill-opacity: 0.2;") Attrib(name="style", LookupCacheAllow=false)

Sample Conditional Item Tooltip definition:

pmAsset.Code + " - " + pmAsset.TempCode Attrib(LookupCacheAllow=false)

Important notes:

  • Attrib is assigned for whole expression, not for particular expression part. It means that if expression is appended with Attrib(name=”style”) then each part of expression should return in-line style (not class).
  • In most cases both expressions (style & tooltip) should not be cached. Especially when auto-refresh of page is enabled. It is possible to disable particular StringExpression caching by setting special attribute LookupCacheAllow at end of expression:
Attrib(LookupCacheAllow=false)

Auto Refresh Delay

Periodically refresh map by given number of seconds. Auto Refresh is disabled when value is empty or less than 1. Auto refresh is active only in enquire mode.

Warning! Whole map is not reloaded (for performance reasons), automatically recalculated are only conditional styles of map items.