Autodesk 15606-011408-9300 Developer Guide - Page 44
Autodesk MapGuide Viewer, API Help, t work during the busy state. For example
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 44 highlights
There are some important points to remember about the busy state: I In general, most write methods and properties are affected by the busy state and return a -1 (busy) error code when called during a busy state. Most read methods and properties are not affected by the busy state. However, there are exceptions to both of these rules. The best way to learn which methods and properties do not work during the busy state is to view the method/property descriptions in the Autodesk MapGuide Viewer API Help. I When your Autodesk MapGuide Viewer application calls an API method that causes a busy state, Autodesk MapGuide Viewer can return control to the application and then go to the next method while still in the busy state. To avoid errors, you need to make sure that Autodesk MapGuide Viewer is not in a busy state when your application calls one of the methods that are affected by the busy state. Your application is most likely to fail when it is about to call two or more API methods-the first an API method that automatically invokes a refresh, and subsequent ones methods that don't work during the busy state. For example: function selectAndZoomToPointObject(mgObj) { var map = getMap(); var sel = map.getSelection(); sel.clear(); sel.addObject(mgObj); map.zoomSelected(); // Busy state begins in zoomSelected() map.setWidth(5, "KM"); // Error occurs because setWidth() fails // if called during the busy state } To avoid errors, you need to make sure that Autodesk MapGuide Viewer is not in a busy state when your application calls one of these methods. To do this you can: I Control map refresh using the autoRefresh flag I Detect when a map refresh is about to happen I Detect a change in the busy state Each of these approaches is described in the following sections. 44 | Chapter 3 Accessing Maps