MapGuide Viewer API
 
 

The MapGuide Viewer API is a set of JavaScript functions used to control the Viewer. Many of the Viewer frames contain embedded JavaScript functions that can be called from other locations. For full details about the available functions, refer to the online MapGuide Viewer API Reference.

To execute any of the Viewer API functions, call them from JavaScript embedded in a page. There are three common techniques for this:

NoteIt is important to know the relationships between the frames. Pages in the task area must refer to parent.parent.mapFrame in order to traverse the frame hierarchy properly. However, if the same function executes from the script frame or the task bar, it only needs to refer to parent.mapFrame, because the script frame and the map frame are part of the same frame set.

Many Viewer API calls will generate requests to the site server, either to refresh data in the Viewer or to notify the site server of a change in Viewer state. These requests are generated automatically.