/ details / embedding modules
 
 
 

Embedding modules into a web page

Example of HTML code for embedding group of modules:

<html>
<head>

<!-- 1. JavaScript files linking: --> 
<script type="text/javascript" src="JS/swfobject.js"></script> 
<script type="text/javascript" src="JS/PanoModulesGroup.js"></script>
 
</head>

<body>

<!-- 2. Containers: --> 
<div id="myMapModule" style="width:200px; height:200px"></div> 
<div id="myPanoModule" style="width:400px; height:300px"></div> 

<!-- 3. Initializing script: --> 
<script type="text/javascript"> 
  var pmg = new PanoModulesGroup("licenseKeyMustBeHere", "virtualTour1"); 
  pmg.addModule("module_Map_Base.swf", "myMapModule"); 
  pmg.addModule("module_Pano_Base.swf", "myPanoModule"); 
</script>

</body>
</html>

1. JavaScript files linking

Two JavaScript classes are used for embedding modules — worldwide known SWFObject and PanoModulesGroup (which is the wrapper for SWFObject). Files swfobject.js и PanoModulesGroup.js must be linked in <head> tag of HTML code.

2. Containers

There must be a container for every module before PanoModulesGroup will be initialized (in this example two <div> are used as containers). Every container must have unique id attribute. Module size is defined by its container.

3. Initializing script

The first line of initializing script creates instance of PanoModulesGroup:

var pmg = new PanoModulesGroup(licenseKey:String[, groupName:String, backColor:String]);

Parameters:

licenseKey
— key for legal use of modules in your domain. You will receive it after purchasing.
groupName
[optional] — any string you want. You have to set groupName, if you are going to use common preferences for this group. Common preferences must be stored in XML file named like: prefs_<groupName>.xml. For group in example above it is prefs_tutorialTour1.xml.
backColor
[optional] — background color of empty modules.

Then you have to add modules:

pmg.addModule(swfFile:String, containerID:String [, backColor:String]);

Parameters:

swfFile
— full name (with path) of module *.swf file.
containerID
— id of HTML container, where module must be loaded.
backColor
[optional] — background color of empty module. Override the same parameter for group.