FusionMaps XT uses XML (eXtensible Markup Language) to
create and manipulate maps. XML is a simple and structured language
that is easy to read and understand. In case you're not aware of XML as
yet, here are a few basics things to know about an XML document:
- An XML document is a simple text file consisting of tags and data
associated with them.
- You can make up your own tags like <mytag></mytag>
to store data.
- Every opening tag requires a matching closing tag like <name>
requires </name>. For example,
<name>John Doe</name>. If
an element has no content, the opening and closing tags may be combined
into a single "shortcut" tag such as <name/>.
- XML tags are case-sensitive. So <name>
should be closed with </name>
and not </Name> or
</NAME>
or any other variant of the same.
- You can define attributes for a tag to render more details. For example,
<name isPetName='true'>John Doe</name>.
Here isPetName is an attribute of the
name element. In FusionMaps XT, we've
four types of attributes:
- Boolean - Attributes which can take a 0 or 1
value. Like <map showLabels='1' >
- Number - Attributes which take a numeric value.
Like <map bgAlpha='70' >
- String - Attributes which take a string value.
Like <map baseFont='Verdana' >
- Hex Color Code - Attributes that take a hex color
code (without #). Like <map bgColor='FFFFDD'
>
- Special characters like ' (quote), " (double quote), % (percentage)
etc are to be replaced by the XML converts. Like, the character "
(double quote) in a string constant must be denoted as ".
A map is controlled by a single XML, that is, you
use a single XML to provide the data and define the cosmetic as well as functional properties for the
map. There are a lot of properties that you can define for each map
type .
However, it is not necessary to define all the attributes for a given
map. For example, if you do not want to change the default setting of
the background (color, alpha, etc.), you do not need to define any attribute
for the background - the default values will be assumed. Thus, each map
can be generated using minimal attributes without concern for every finer
detail. As you become more proficient in the map attributes, you could
use it to create complex maps with a wide range of features and an informative
appearance.
FusionMaps XT has a specific XML structure for each map. The XML structure for each map is detailed in respective map's "Map XML Sheet" page.
|