You are viewing documentation for an older version. For current documentation - click here.

You can directly embed most of the special characters and punctuation marks in the XML/JSON data source of your map. However, &, <, >, ' (apostrophe) and "(quote) need to be specially encoded when providing the same as a part of the map data. Apart from this, there is no need to encode any other special character.

The XML/JSON used for the map above is given below:

<map borderColor='005879' fillColor='D7F4FF' numberSuffix=' Mill.' baseFontSize='9'>
 <data>
  <entity id='NA' value='515' displayValue='&quot;Half a billion&quot;'/>
  <entity id='SA' value='373' displayValue='10% of Asia&apos;s'/>
  <entity id='AS' value='3875' displayValue='&gt;1Billion'/>
  <entity id='EU' value='727' displayValue='11% of Total'/>
  <entity id='AF' value='885' displayValue='Add NA &amp; SA'/>
  <entity id='AU' value='32' displayValue='&lt;100 Million'/>
 </data>
</map>
{
"map": {
 "borderColor": "005879",
 "fillColor": "D7F4FF",
 "numberSuffix": " Mill.",
 "baseFontSize": "9"
  },
 "data": [
  {"id": "NA", "value": "515" "displayValue": "&quot;Half a billion&quot;" },
  {"id": "SA", "value": "373" "displayValue": "10% of Asia&apos;s" },
  {"id": "AS", "value": "3875" "displayValue": "&gt;1Billion" },
  {"id": "EU", "value": "727" "displayValue": "11% of Total" },
  {"id": "AF", "value": "885" "displayValue": "Add NA &amp; SA" },
  {"id": "AU", "value": "32" "displayValue": "&lt;100 Million" }
  ]
}

Let's see how to use special punctuation marks like - &, <, >, ' (apostrophe) and "(quote) in the following sections:

Using & sign

To display & character on a map, you need to use the encoded form of the character - &amp;  in your map data (XML or JSON). It is applicable in both Data URL and Data String methods.

When using the HTML embedding method and Data string method, it is essential to encode & character to %26.

Using < or > sign

You can't directly use < and > characters in FusionMaps XT data as these are invalid characters from XML perspective. To use < and >, you first need to convert them into &lt; and &gt;, respectively. It is applicable in both Data URL and Data String methods.

Typically, text in FusionMaps XT is rendered in normal mode. But, you can also render the text in limited HTML mode too. In case, you need to use HTML text as part of any label, you'll need to customize the map object using Styles and set isHTML property to 1 in Font Styles. Also, you need to double encode the < and > characters in this case, or else these are considered as starting and end brackets of HTML tags. Hence, &amp;lt; should be used instead of < and &amp;gt; should be used instead of >. A sample data is shown as below:

When using the HTML embedding method and Data string method, it is essential to encode < and > characters to %26lt; and %26gt; ,respectively. In case, HTML text mode is set on, %26amp;lt; and %26amp;gt; are to be used, respectively.

Using Apostrophe(') sign

To display the ' (apostrophe) character on a map, it is recommended to encode it as &apos;. It is applicable in both Data URL and Data String methods.

When using the HTML embedding method and Data string method, it is essential to encode '(apostrophe) character to %26apos;.

Using Quote(") sign

To display the " (double-quotation or quotes) character on a map, it is recommended to encode it as &quot;. It is applicable in both Data URL and Data String methods.

When using the HTML embedding method and Data string method, it is essential to encode "(quote) character to %26quot.

Using Percent(%) sign

At times, you might also want to include the % (percent) sign in your map data. To display % (percent) sign on a map, you can simply include it in the XML/JSON data source of the map. It is applicable in both Data URL and Data String methods.

Note that while using the HTML embedding and Data String method, it is essential to encode percent character to %25.