Locator Maps » Version 4.0

ID #1022

13. Is it possible to display a formatted text in a popup window?

The popup window allows you to display HTML formatted texts. Open the locator_map.xml in any text editor and in the <comment> section of the desired region create a CDATA element with your HTML formatted text inside as shown below:

...
<state>
  <id>7</id>
  <name>Michigan</name>
  <link></link>
  <comment><![CDATA[<font size="15"><b>Address:</b> Main str, 123-45<br><b>Phone:</b> +1-875-555-****
<b><a href="http://www.site.com/chat.php">Online chat</font></b></a>]]></comment> 
  <color_map>0x7798BA</color_map>
  <color_map_over>0x0054A6</color_map_over>
  <frame></frame>
  <image></image>
</state>
...

Alternatively, you can paste HTML without using CDATA, but you will need to escape all special characters, for instance, the following HTML:

<i>Italic text</i>

transforms to:

&lt;i&gt;Italic text&lt;/i&gt;

In the XML it looks as follows:

...
<state>
  <id>7</id>
  <name>Michigan</name>
  <link></link>
  <comment>&lt;i&gt;Italic text&lt;/i&gt;</comment> 
  <color_map>0x7798BA</color_map>
  <color_map_over>0x0054A6</color_map_over>
  <frame></frame>
  <image></image>
</state>
...

Of course, it is difficult to convert an HTML to the escaped version manually, so you can use any automatic HTML encoders:   

http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/Encode.aspx

Tags: -

Related entries:

Last update: 2011-04-28 07:45
Author: Fla-shop Team
Revision: 1.3

Digg it! Share on Facebook Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 (0 Votes)

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry