|
|
XML Locator World v3
Country level usage example
This example demonstrates one of the possible variants of XML Locator World v3 installation as a 3 level map.
Map contains Global, Region, and Country Views. In this example the map automatically colorizes
areas and makes them clickable or unclickable based on the information about points from the sample XML config.
This example is based on the standard package of USFlashMap XML Locator World v3 Professional using few PHP tricks and slight config modifications.
We hope this example will serve as a good starting point for developers involved into flash map integration.
Installation
- First of all you must upload sample files on the web server, so that you can launch it from "http://....".
Suppose you uploaded it into http://localhost/flashmap. This will be a good start. Your "localhost" must support PHP v5.0 or higher.
Please note, that until you upload package files on the server running PHP, you won't be able to view the map above.
- Add license key to the package. License key is the key.swf file that you can obtain from your USFlashMap Account at USFlashMap.com. Commercial or demo key will work.
If you do not have an account yet - order a demo version of XML Locator World v3. You can start here.
When you log-in in the user area please find the link "Get key" in the product download section. This will generate key.swf file.
Save it to "http://localhost/flashmap/key.swf".
- Insert the code.
Suppose you will be testing the map at "http://localhost/index.html" page. Please insert the following code into this page:
As you can see, we are using <iframe> with the name "map" and load the file "flashmap/map.php" in it. This is a very simple way to insert
flash application as it does not require additional changes in paths or variables. Just define the URL of the map.php file on your server once
and copy this code to any page of your site without additional changes.
Adding Locations
Find the file applicationdata/locations.xml In this package. This file contains information for all points on the map.
When you add a new location to the area that is currently incative the map automatically highlights it after you reload it.
Let us insert a new point on the map, somewhere in Africa. For example, Cairo (Latitude: 30, Longitude: 31.1). You should use
the following code to insert a new location:
| |
|
<group name="Egypt" widget="applicationdata/widgets/star.swf" color="0xFF5959">
<point areaGroupId="c-EG" name="Cairo" tooltip="Here is the text on rollover " lat="30.0" long="31.1" >
<action type="url">http://en.wikipedia.org/wiki/Cairo</action>
</point>
</group>
|
Copy/Paste this code in the "applicationdata/locations.xml" file. Save changes and reload your test map. You will see Africa highlighted on the Global View, Egypt on the regional and city Cairo inside the country.
| Tag <group> |
Contains tags <point> inside. Group actually means country. If you want to add more points in Egypt, just add more point inside "Egypt" group. |
| Tag <point> |
Always located inside some <group> tag. Note the parameter - areaGroupId = "c-EG". In this case "EG" is the ISO code of Egypt and "c-" is the required prefix. Countries list with codes that map uses you can find in "applicationdata/countrycodes.txt" file. |
| Tag <action> |
This tag defines what will happen after user click on the point. There are 2 possible actions - open URL and open HTML description. Detailed example on how to create HTML description you can find in the product manual |
Re-grouping Countries
All countries are defined in the file "applicationdata/data_arrays.php". This file contains two PHP arrays: countries and regions.
Each element of the countries array contains the name of the appropriate region from the region array. In your script you can include "data_arrays.php"
and have regions and countries tree information within your script.
Further Steps
This page describes only the changes that were made to the standard package of the XML Locator World v3.
For other details please download and review the product manual.
|
|
| |
Requirements
- Demo or commercial key
- Support of PHP v5.0.* or above
- FTP access to your website
- Adobe Flash Player 8 or above
|
|