Zoom Maps

ID #1072

21. Is it possible to update the map dynamically with a PHP/Perl/ASP script generating an appropriate XML “on the fly”?

It is possible. You need to use Flashvars to pass a dynamic XML to the map.

If you are using the SWFObject method,  please refer to the following sample code:

 

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
	var flashvars= {
        xmlfile1: "locator_map_script.php",
		  datafile: "data.swf"
	};
	var params = {
	wmode: "transparent"
	};
	swfobject.embedSWF("locator_map.swf", "Map", "600", "300", "9.0.0", "", flashvars, params);
</script>
<div id="Map">&nbsp;</div>

 

If you are using the non-SWFObject method, please refer to the following sample code:

 

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="600" height="300" id="world" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="locator_map.swf" />
<param name=FlashVars value="xmlfile1=locator_map_script.php">
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<embed src="locator_map.swf?xmlfile1=locator_map_script.php" quality="high" bgcolor="#FFFFFF" width="600" height="300" name="world" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

The script must create and return a valid XML file to the output. You can use PHP, ASP, Perl or any other script languages for this.

 

Tags: -

Related entries:

Last update: 2011-05-11 09:45
Author: Fla-shop Team
Revision: 1.0

Digg it! Share on Facebook Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 (0 Votes)

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry