The Fusion API is often used when MapGuide Fusion viewer is used. The most important object in the Fusion API is the Fusion object. Map or other widgets are obtained through the Fusion global object.
The following describes how to obtain the javascript code of the Fusion object. It is available here for your reference:
Var mgApiMapWidgetId = 'map ';
Var MainFusionWindow = GetFusionWindow ();
Var OpenLayers = MainFusionWindow. OpenLayers;
Var Fusion = MainFusionWindow. Fusion;
Alert (Fusion );
/* Locate the Fusion window */
Function GetFusionWindow (){
Var curWindow = window;
While (! CurWindow. Fusion ){
If (curWindow. parent & curWindow! = CurWindow. parent ){
CurWindow = curWindow. parent;
} Else if (curWindow. opener ){
CurWindow = curWindow. opener;
} Else {
Alert ('could not find Fusion instance ');
Break;
}
}
Return curWindow;
}
After obtaining the Fusion object, you can get the map object through Fusion. getMapById () and get the Widget through Fusion. getWidgetById () or Fusion. getWidgetsByType.
Cheers,
Junqilian