The <map-script> element is used to specify one or more
scripts that will execute during the imfMainMap.jsp script after all
normal routines. If more than one map script is defined, the scripts will be
executed in the order that they appear in the site configuration file.
Your map scripts can be used to set the properties of the map, or to generate
dynamic javascript that will be executed once the map page is loaded. To add
javascript to the map, your map script should set one of the following
session variables to contain the javascript to be executed like the following examples:
- session.setAttribute("imfMainMap.one_time_javascript","alert('hello world');");
- session.setAttribute("imfMainMap.javascript","alert('hello world');");
The difference between these attributes is that the first one is removed after it is
used by imfMainMap.jsp.
| Frequency |
Parent Elements (this element is valid within): |
|
POS+ |
<site-config> |
| |
|
|
| Frequency |
Description (in this context) |
|
POS+ |
This element may appear multiple times within the <site-config> element in the specified sequence. |
| |
|
|
|
Attributes |
Description |
|
file |
The script name to execute. Must be in the IMF installation directory or a
subdirectory of the IMF installation directory. Required.
|
| |
|
|
Example:
<map-script file="startup1.jsp" />
<map-script file="ext/moxi/startup2.jsp" />