Sign in to follow this  

Coldfusion State Links To Open State Map On Same Page

Recommended Posts

I am having an incredibly difficult time trying to click on a state on the USA map and have the state map open in a div directly below the USA map. I can do this relatively easily with FusionCharts since the same chart opens with each time, but in this case a different SWF file is involved.


The XML for the USA map looks like this:


<map borderColor='005879' fillColor='D7F4FF' numberSuffix='' includeValueInLabels='1' labelSepChar=': ' baseFontSize='9'>

<colorRange><color minValue='0' maxValue='10' displayValue='Low' color='A7E9BC' />

<color minValue='100' maxValue='50' displayValue='Middle' color='FFFFCC' />

<color minValue='50' maxValue='9999999' displayValue='High' color='FF9377' />



<entity id='' value='4' link='javaScript%3AupdateStateMap%28%29%3B' />

<entity id='AK' value='1' link='javaScript%3AupdateStateMap%28AK%29%3B' />

<entity id='AL' value='4' link='javaScript%3AupdateStateMap%28AL%29%3B' />

<entity id='AR' value='7' link='javaScript%3AupdateStateMap%28AR%29%3B' />

<entity id='AZ' value='12' link='javaScript%3AupdateStateMap%28AZ%29%3B' />

<entity id='CA' value='390' link='javaScript%3AupdateStateMap%28CA%29%3B' />




To troubleshoot, I have attempted to hard-code the function like this:



function updateStateMap(state_code){


* var strURL = "Data_State.cfm?state_code=" + state_code;

* strURL = escape(strURL);

* var chartObj = getChartFromId("TestMapState");

* chartObj.setDataURL(strURL);



var map = new FusionMaps("/siteadmin/reporting/FusionMaps/FCMap_Arizona.swf","","580","300","0","1");


* map.setDataXML(dataURL);








I was hoping to use the commented code, but getChartFromID won't work, presumably because the chart/map hasn't rendered yet.


Thank you for your assistance.



Share this post

Link to post
Share on other sites
Guest Sumedh

Hi Jeff,


We are glad to inform you that, recently we have released FusionMaps XT v3.2


You can now render maps on devices where Flash player is not supported (like in iPhone/iPad), is not installed or is disabled. For this, FusionMaps XT uses the built-in JavaScript rendering capabilities.


The maps, rendered by this module, purely use JavaScript and do not need Flash Player at all.


FusionMaps XT uses new JavaScript API for better performance and functionality.


The getChartFromId/ getMapFromId function is deprecated.


To get map reference Id, you would have to use following mechanism:


Ref. Code:

var map = FusionCharts("myMapId");


For more information, please refer the following URL's:

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this