Executing this example requires an XML file named MapXmlExample_RU.xml, topobase Russia.svg, and an HTML page, that contains a map. Map settings must be converted to JSON.
NOTE. When XML is automatically converted to JSON, the "@" character, which does not need to be removed, appears before attributes.
The XML file must contain the following items:
Scales with the IDs BarVisualScale_color and BarVisualScale (in items dictionary);
Data sources with the IDs source and BarBackSource (in the data source list ), that store data for the following four regions: the Yamalo-Nenets Autonomous District, Khanty-Mansijsk Autonomous District, Tyumen region, Nenets Autonomous District;
Dependency objects with the IDs BarBackDataDependency, StaticWidthDataDependency, BarHeightDataDependency, and StaticColorDataDependency (in the items dictionary).
To set a bar mark on the map, add the MapAreaVisual item to the Visuals item.
NOTE. In case object properties are described as items and not as attributes, the following syntax is used: ObjectName.PropertyName (such as, MapLayer.Visuals).
"MapLayer.Visuals":
{
"MapBarVisual":
{
"Background": "{BarBackDataDependency}",
"BarDistance": "1",
"LeastWidthPart": "4",
"Width": "{StaticWidthDataDependency}",
"Name": "Birth rate",
"MaxBarsCount": "4",
"Visibility": "Visible",
"Height": "{BarHeightDataDependency}",
"LeastHeightPart": "3",
"BorderThickness": "1",
"IsPercentage": "False",
"Id": "BarVisual",
"BorderColor": "{StaticColorDataDependency}",
"DataSource": "{source}"
}
}
After executing the example bar factor is displayed for four regions on the map:
See also: