[mapguide-users] fusion and javascript

Mark Pendergraft markp at Meadgilman.com
Mon Aug 18 18:59:13 EDT 2008


Hello All,
I’m having a lot of trouble with Fusion and javascript.  I am somewhat of a newb to fusion, so please bare with me.
I have a aspx page in the task pane which I have been adding some buttons with some javascript too, in order to test things out.
At this point, it appears that any call to a function defined in MapGuide.js (../fusion/mapguide/mapguide.js) won’t break my code.  For example “parent.document.getElementById('Map').widget.aMaps[0].drawMap();” would refresh the map.
However, any calls to MapGuideViewerApi.js will not work.
I have tried including it into my page, and I have also tried calling it in different fashion.
For example:
var Fusion = window.top.Fusion;
var map = Fusion.getWidgetById('Map');
map.Refresh();

Why won’t the MapGuideViewerApi.js functions work?  If they can’t be used, how do i zoom and digitize points?
Also, I mentioned that the mapguide.js functions work, yet setSelection does not.
I get the following error

Fusion Error:
WARNING: Exception occurred in AJAX callback.
[object Error]
Location: {1} ({2})
xx)

At this point, the functions I need to work in order for my code to function are:
setSelection
digitizePoint
digitizeRectangle

None of which work  
Any help or a push in the right direction would be greatly appreciated.

Setup:
MGOS 2.0.1
Fusion 1.0.6
Autodesk MapGuide Studio 2009
Using IIS, VB, and VS 2005 Pro


More information about the mapguide-users mailing list