% 'Page: FusionMaps.asp 'Author: InfoSoft Global (P) Ltd. 'This page contains functions that can be used to render FusionMaps. 'encodeDataURL function encodes the dataURL before it's served to FusionMaps. 'If you've parameters in your dataURL, you necessarily need to encode it. 'Param: strDataURL - dataURL to be fed to map 'Param: addNoCacheStr - Whether to add aditional string to URL to disable caching of data Function encodeDataURL(strDataURL, addNoCacheStr) 'Add the no-cache string if required if addNoCacheStr=true then 'We add ?FCCurrTime=xxyyzz 'If the dataURL already contains a ?, we add &FCCurrTime=xxyyzz 'We replace : with _, as FusionMaps cannot handle : in URLs if Instr(strDataURL,"?")<>0 then strDataURL = strDataURL & "&FCCurrTime=" & Replace(Now(),":","_") else strDataURL = strDataURL & "?FCCurrTime=" & Replace(Now(),":","_") end if end if 'URL Encode it encodeDataURL = Server.URLEncode(strDataURL) End Function 'renderMap renders the JavaScript + HTML code required to embed a map. 'This function assumes that you've already included the FusionMaps JavaScript class 'in your page. ' mapSWF - SWF File Name (and Path) of the map which you intend to plot ' strURL - If you intend to use dataURL method for this map, pass the URL as this parameter. Else, set it to "" (in case of dataXML method) ' strXML - If you intend to use dataXML method for this map, pass the XML data as this parameter. Else, set it to "" (in case of dataURL method) ' mapId - Id for the map, using which it will be recognized in the HTML page. Each map on the page needs to have a unique Id. ' mapWidth - Intended width for the map (in pixels) ' mapHeight - Intended height for the map (in pixels) ' debugMode - Whether to start the map in debug mode ' registerWithJS - Whether to ask map to register itself with JavaScript Function renderMap(mapSWF, strURL, strXML, mapId, mapWidth, mapHeight, debugMode, registerWithJS) 'First we create a new DIV for each map. We specify the name of DIV as "mapId"Div. 'DIV names are case-sensitive. %>