FusionMaps 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>. e.g.,
<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. e.g.,
<name isPetName='true'>John Doe</name>.
Here isPetName is an attribute of the
name element. In FusionMaps, we've
four types of attributes:
- Boolean - Attributes which can take a 0 or 1
value. Like <map showNames='1' >
- Number - Attributes which take a numeric value.
Like <entity value='200' >
- String - Attributes which take a string value.
Like <entity id='MyId' >
- 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 ".
The entire FusionMaps map is controlled by XML parameters i.e., you
use XML to define the cosmetic as well as functional properties for the
map. There are a lot of properties that you can define for each map.
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 background settings (color, alpha etc.), you don't need to define any attributes
for the same - the default values will be assumed. Thus, each map
can be generated using minimal attributes without concern for finer
details. 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.
The next section discusses all the possible attributes for any FusionMaps map. If you first want to see how to create a FusionMaps map, you can directly jump to "How to use FusionMaps" section. |