Sign in to follow this  
Earl.Bennett

Error when calling getEntityList

Recommended Posts

I have discovered the (undocumented) API getEntityList.  This would be VERY useful in our application.

I am pretty much copying what the FusionMaps GUI configuration tool does.  In my FC_Rendered event handler I have the following code..

var widget = infosoftglobal.FusionMapsUtil.getMapObject(DOMid);

var entities = new Array();

entities = widget.getEntityList();

 

This works great the first time I call it.  However, when I load a new map, when I make this call from the FC_Rendered handler I get the following error..

Unable to evaluate the expression. Operation not supported. Unknown error: 0x80020102

Any suggestions  as to what I might be doing?

Earl

Share this post


Link to post
Share on other sites

Sudipto,

Thank you for your reply.  Unfortunately, I am setting the registerWithJS flag for every map that I load.  I set the debug flag, and verified via the messages in the debug window that the control is (claiming to) register with Javascript when the call fails.

I have also reduced the XML used to load each map to the following minimal XML:

<map animation="0" showShadow="0" showBevel="0" fillColor="F1F1F1" />

Do you have any otherr suggestions?

Earll

Share this post


Link to post
Share on other sites

With more testing, I have found that ANY call I make, including setDataXML(), fails after I load the second map.  I could live without the getEntityList(), but not being able to make other calls is a real problem.

Again, I have verified that the registerWithJS flag is set when I create the FusionMaps object, and the debug window shows the message "INFO: Map registered with external script. DOM Id of map is serviceMapID".  However, I can't make any calls to the object. :w00t:

Any suggestions would be greatly appreciated...

Earl

Share this post


Link to post
Share on other sites

After much hair pulling, I have tracked the problem down to the following code contained in the render function in FusionMaps.js..

if(!document.embeds[this.getAttribute('id')] && !window[this.getAttribute('id')])

window[this.getAttribute('id')]=document.getElementById(this.getAttribute('id'));

When the second map is loaded, the if statement prevents window[this.getAttribute('id')] being updated, and the flash object can not properly register with the javaScript. The various callback methods (getEntityList, setDataXML, etc.) do not get created, and an error occurs when I try to call them.

If I comment out the if statement, allowing the assignment to always execute, everything works fine.

The FusionMaps.js used by the Maps GUI tool is much different than the one used by the FusionMaps product itself, and does not contain this code.

By the way, I'm using IE 7, with the latest version of FusionMaps (3.0?)

Earl

 

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