![]() |
![]() |
|||||||||||||||||||
|
||||||||||||||||||||
GETTING STARTEDDownload latest version of amMap. Unzip everything to some folder. Open ammap.html with your browser, you should see a sample map. View source of this file. The script which places map on this page is the following: <!-- ammap script--> <script type="text/javascript"> To display map on your html page you will need to paste these lines to your html (or php or asp or any other) source in the place you want your map to appear. AmMap uses a most popular way of embedding flash in web pages - SWFObject, however you can use a standard Adobe way of embedding flash. SWFObject file is in ammap/ folder, and this line: <script type="text/javascript" src="ammap/swfobject.js"></script>
tells browser where to look for it. Size of a map and other parameters Size of a map is defined in this line: var so = new SWFObject("ammap/ammap.swf", "ammap", "1000", "600", "8", "#444444");
"1000" is map width and "600" is map height. Put your own numbers here. You can also set percent values (for example 100%). "8" is flash player version needed to display amMap, do not change it. "#444444" is background color of your map. Files and paths "ammap/ammap.swf" points to the main amMap script. If you if you change folder or file name, change it here too. the line so.addVariable("path", "ammap/");
passes to amMap script variable "path" - the folder where all your files, icons and maps are. The following lines: so.addVariable("data_file", escape("ammap/ammap_data.xml"));
so.addVariable("settings_file", escape("ammap/ammap_settings.xml")); tells amMap script where your data and settings files are. You can use your file names, and extensions too - the important thing is that the result of these files is a valid XML. so.addVariable("preloader_color", "#999999"); tells amMap script color of preloader bar. There are two more variables which you can pass to amMap script directly from html - "loading_data" and "loading_settings". These variables tell amMap script what text to display while data and settings are loaded. By default, these texts are "Loading data" and "Loading settings". If you want to change them, you should add these lines before "so.write("flashcontent");" line: so.addVariable("loading_data", "Your custom text");
so.addVariable("loading_settings", "Your custom text"); All other map settings are set in ammap_settings.xml file. All map data is set in ammap_data.xml file. Maps In the ammap/maps/ folder you will find two files - "world.swf" and "continents.swf". World.swf is a political world map with country borders. Every country is a separate area and can have a custom color, zoom level and other properties. Continents.swf is a world map with continents as separate areas. In future I plan to add more maps. Icons In the ammap/icons folder you will find a set of icons which you can load on top of a map. You can also create your own icons. Export.php File export.php is used for exporting map as an image. I recommend you to delete this file if you are not going to use this feature. Note, that export.php file does not generate an image if your site visitor doesn't have a proper flash player version installed. Examples In the examples folder you will find some html files and folders with the same names. In these folders there are a custom settings and data files. You can open these html files with your browser and then check xml files in corresponding folders to see how certain things are achieved. Editing xml files I recommend using a free PSPad editor for editing XML files.When something is not working The first thing you should check is whether your data and settings XML files are not corrupted. The quick way to do this is to open xml file with your browser. Both IE and Firefox will display where the error is. |
||||||||||||||||||||
|
||||||||||||||||||||