Navigation
Records in this category
- 04. What are the requirements to install and use Locator Maps?
- 19. Is it possible to install Locator Map to WordPress (Joomla, Drupal, other CMS) website?
- 18. Is it possible to update the map dynamically with a PHP/Perl/ASP script generating an appropriate XML "on the fly"?
- 14. How to change the background color of the Locator Map?
- 01. How do I install the Locator Map on a webpage?
- 15. How to make the background of the map transparent?
- 16. How to set an image as a background for the map?
- 11. How to change the names on the Locator Map (countries, states, regions etc)?
- 08. How to change the colors of each region on the map?
- 09. How to change the colors of texts on the map?
- 05. How to open some URL when a user clicks on the map?
- 07. How to open a URL in a new window?
- 12. How to display some data in a popup window when a user moves the mouse over a region?
- 13. Is it possible to display a formatted text in a popup window?
- 10. How to change colors of a popup window?
- 20. What is the difference between Locator Map 3.0 and 4.0?
- 17. How to display some data on the page when a user clicks a region?
- 02. How to install Locator Map 4.0 to my website (detailed description)?
- 03. Can I test the map locally?
- 06. I tried to add a link to a state in the map, but it is not working. Why?
Tags
Locator Maps » Version 4.0
17. How to display some data on the page when a user clicks a region?
Sometime you may want to display some info on the page rather than in the popup window. In the Locator Map you can do this. Here is a step-by-step:
1. Open the locator_map.xml in any text editor and find the region you want to associate with some text.
2. In the <link> tag put the following text:
javascript:displayText('id');
The id here is some name that will identify this particular region. For instance:
...
<state>
<id>7</id>
<name>Michigan</name>
<link>javascript:displayText('michigan');</link>
<comment></comment>
<color_map>0x7798BA</color_map>
<color_map_over>0x0054A6</color_map_over>
<frame></frame>
<image></image>
</state>
...
3. In the page where the map is displayed add the following script to the source HTML file after the <HEAD> tag:
<script type="text/javascript">
function displayText(div_name)
{
document.getElementById('main_text').innerHTML=document.getElementById(div_name).innerHTML;
}
</script>
Basically, this script finds the "main_text" DIV block and replaces its contents with contents of the given DIV identified by the div_name variable, in our case it is 'michigan'. Obviously, you should place those DIVs somewhere in the source of the HTML file, for example:
... <DIV id=main_text>This text will be replaced when you select a region on the map</DIV> ... <DIV id=michigan style="DISPLAY: none"> Michigan dealer Address: Phone: Fax: </DIV> ...
The same way you can assign a text for every region on the map. Make sure, though, you are using a unique id for each region and provide a DIV with the text for each region as well. You need only one main_text DIV, however.
Tags: -
Related entries:
- 04. What are the requirements to install and use Locator Maps?
- 18. Is it possible to update the map dynamically with a PHP/Perl/ASP script generating an appropriate XML "on the fly"?
- 14. How to change the background color of the Locator Map?
- 01. How do I install the Locator Map on a webpage?
- 16. How to set an image as a background for the map?
Last update: 2012-03-14 12:30
Author: Fla-shop Team
Revision: 1.2
You cannot comment on this entry