Navigation
Records in this category
- 03. What are the requirements to install and use Multi-level Maps?
- 01. How do I install the Multi-level Map on a webpage?
- 11. Is it possible to install Multi-level Map to WordPress (Joomla, Drupal, other CMS) website?
- 07. How to change the background color of the Multi-level Map?
- 08. How to make the background of the map transparent?
- 09. How to set an image as a background for the map?
- 12. How to change the actual size of the map on a webpage?
- 10. How to change the names on the Multi-level Map (countries, states, regions etc)?
- 05. How to change the colors of each region on the map?
- 06. How to change the colors of texts on the map?
- 04. How to open some URL when a user clicks on the map?
- 02. How to install Multi-Level Map to my website (detailed description)?
- 13. How to add a few cities? (video)
Tags
Multi-level Maps
04. How to open some URL when a user clicks on the map?
Note that on a multi-level map you can assign a URL only to objects that do not have deeper map levels associated with them. For example, on the USA multi-level map you can assign a URL to counties and cities, but not to states.
Here is how you can assign a URL to a click on the Lauderdale County in Alabama.
1. Find the map.xml file in the data folder.
2. Open it in any text editor like Notepad and look for a desired name:
... <name>Alabama</name> <URL map="us_al.swf" xmlfile1="us_al.xml" xmlfile2="us_al_data.xml">#</URL> ...
Below the name tag you should see the filename of the XML that contains the map layer for that particular region. In our case it is us_al.xml – the XML containing the layer with Alabama counties.
3. Open that file in a text editor and look for lines:
... <name>Lauderdale</name> <URL>http://www.mysite.com</URL> ...
Write the URL you need within this tag as shown above.
Any valid URL will suite here. Additionally, you can specify custom JavaScript code here:
... <URL>javascript:window.alert(‘Hello world!’)</URL> ...
If you want to execute some JavaScript and open the next map layer when a user clicks on the map, please contact us and we will modify the map accordingly for you.
In order to assign a certain URL to a city (or another region on a deeper layer of the map), you should do the following:
4. Find the file of the next layer. Its name is
similar to the name of XML but with the “data” suffix, in our case it is us_al_data.xml. You may have noticed that name in the code above in the xmlfile2 parameter:
... <name>Alabama</name> <URL map="us_al.swf" xmlfile1="us_al.xml" xmlfile2="us_al_data.xml">#</URL> ...
5. Open the file in a text editor and find the city you need, then insert the URL in the link property:
... <p name="Birmingham" link="http://www.fla-shop.com" type="font1" x="-7" y="-72" x_h="-2.8" y_h="-6.1" info="" frame="" img="" symbol="arrow1" /> ...
Now, when you click on the city, it will open the specified link.
There is a more convenient way, however. You can use the built-in WYSIWYG editor to generate XML automatically. Open the preview of the map using the index.html file in your purchased zip file. In the preview, scroll down until you see the WYSIWYG map editor. It allows you to add, edit and remove pinpoints and to copy the corresponding XML to the clipboard. All you need then is to paste that XML code to an appropriate file – either map_data.xml or the XML of a particular layer (for instance, us_al_data.xml as shown above).
Tags: -
Related entries:
- 03. What are the requirements to install and use Multi-level Maps?
- 07. How to change the background color of the Multi-level Map?
- 08. How to make the background of the map transparent?
- 10. How to change the names on the Multi-level Map (countries, states, regions etc)?
- 05. How to change the colors of each region on the map?
Last update: 2011-05-11 19:53
Author: Fla-shop Team
Revision: 1.4
You cannot comment on this entry