Navigation
Records in this category
- 04. What are the requirements to install and use USA Zoom Maps?
- 01. How do I install the USA Zoom Map on a webpage?
- 02. How to install USA Zoom Map to my website (detailed description)?
- 03. Can I test the map locally?
- 20. Is it possible to install USA Zoom Map to WordPress (Joomla, Drupal, other CMS) website?
- 10. How to change the background color of the USA Zoom Map?
- 11. How to make the background of the map transparent?
- 12. How to set an image as a background for the map?
- 13. How to change the actual size of the map on a webpage?
- 22. How to change the names the states on the USA Zoom Map?
- 14. How to change the colors of each region on the map?
- 15. How to change the colors of texts on the map?
- 19. Is it possible to place the map multiple times on the same webpage?
- 16. How to display some data in a popup window when a user moves the mouse over a state?
- 17. Is it possible to display a formatted text in a popup window?
- 18. How to change colors of a popup window?
- 05. How to add or edit a pin? (video)
- 06. How to open a URL when a user clicks the pin?
- 09. How to open a URL in a new window?
- 07. How to display a popup window when a user moves the mouse over the pinpoint?
- 08. How to display some data on the page when a user clicks a pin?
- 21. Is it possible to update the map dynamically with a PHP/Perl/ASP script generating an appropriate XML “on the fly”?
Tags
Zoom Maps
08. How to display some data on the page when a user clicks a pin?
Sometimes you may want to display some info on the page rather than in the popup window. In the USA Zoom Map you can do this. Here is a step-by-step:
We will use the visual WYSIWYG editor.
1. Open the preview of the map using the locator_start.html file in your purchased zip file. In the preview, scroll down until you see the WYSIWYG map editor.
2. In the editor zoom the state you need and click a city pin. You will see its name in a box at the right side of the editor. Type the following code there:
javascript:displayText('id');
The id here is some name that will identify this particular pinpoint. For instance:
javascript:displayText('Tuscon');
3. In the page where the map is displayed add the following script to the source HTML file after the <HEAD> tag:
<SCRIPT>
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 ‘Tuscon’. 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 pin on the map</DIV> ... <DIV id="Tuscon" style="DISPLAY: none"> Tuscon dealer Address: Phone: Fax: </DIV>
The same way you can assign a text for every pinpoint on the map. Make sure, though, you are using a unique id for each pin and provide a DIV with the text for each pin as well. You need only one main_text DIV, however.
Tags: -
Related entries:
- 04. What are the requirements to install and use USA Zoom Maps?
- 01. How do I install the USA Zoom Map on a webpage?
- 02. How to install USA Zoom Map to my website (detailed description)?
- 19. Is it possible to place the map multiple times on the same webpage?
- 16. How to display some data in a popup window when a user moves the mouse over a state?
Last update: 2011-06-15 07:19
Author: Fla-shop Team
Revision: 1.1
You cannot comment on this entry