Bernie6421

Change Country Color With Javascript

Recommended Posts

Hi,

 

I have a list of countries in HTML and a corresponding fusion map.

I want to highlight the country in the map when selecting (or hover) the country in the HTML list.

So I have to access the map from the HTML page via javascript.

Is that possible?

In the docu I only found the other way round: From the map to the HTML/javascript via the FC_Event Javascript method.

 

Bernhard

Edited by Bernie6421

Share this post


Link to post
Share on other sites

Hi Angshu,

 

thanks a lot for the answer, I tried this out but I have problems with the getXml and setXML methods.

Whenever I use the getMapFromId() I get an object of type object HTMLEmbedElement.

But on this object I can't use the getXML or setXMl methods.

 

So this code doesnt work, I get the error message: getMapFromId("Map1Id").setDataXML is not a function

mapObj = getMapFromId("Map1Id");
oxml = mapObj.getXML();

 

Do you have an idea about this?

 

Bernhard

Share this post


Link to post
Share on other sites

Any updates on the attached demo? I tried using this too to do the same thing but the function getMapFromId() returns NULL.

 

I have registerJS enabled.

 

Thanks!

Edited by nimrod

Share this post


Link to post
Share on other sites
Guest Sumedh

Any updates on the attached demo? I tried using this too to do the same thing but the function getMapFromId() returns NULL.

 

I have registerJS enabled.

 

Thanks!

 

Hi,

 

Please find modified attached demo for your reference.

Test_FusionMaps.zip

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