Zoom Maps

ID #1065

17. 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 plain-text editor and in the <info> 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>
  <URL></URL>
  <info><![CDATA[<b>Address:</b> Main str, 123-45<br><b>Phone:</b> +1-875-555-6343<br><b><a href=”http://www.site.com/chat.php”><font size=”12”>Online chat</font></b></a>]]></info> 
  <color>0x7798BA</color>
  <color_>0x0054A6</color_>
  <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>
  <URL></URL>
  <info>&lt;i&gt;Italic text&lt;/i&gt;</info> 
  <color>0x7798BA</color>
  <color_>0x0054A6</color_>
  <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-05-11 09:21
Author: Fla-shop Team
Revision: 1.0

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