Upgrading API Client to API v8.1
Besides some new capabilities, API v81 differs only minimally from API v8.0. As a result, clients can easily upgrade their API to take advantage of the new capabilities.
§ Upgrading a JavaScript Client
§ Property, Method, Event, and Interface Changes in API v8.1
Step 1: Create an SGWorld81 instance instead of SGWorld80 instance
Replace the SGWorld80 instance creation with the new SGWorld81 instance.
Step 2: Change all variable types to the new 8.1 type
For example, rename:
IPosition80 pos =…
to:
IPosition81 pos =…
Note: Geometry and related interfaces such as IGeometry and ILinearRing that had no number in their interface name should not be renamed.
Step 3: Recompile the code
In most cases, this will suffice. Most compilation errors will result from forgetting type renaming. Compilation errors may also occur, though far less commonly, due to:
§ Modification of a property or method signature in 8.1 compared to v8.0.
§ Removal of a property or method in v8.1 compared to v8.0.
See “Property, Method, Event, and Interface Changes in API v8.1” in this chapter for more details.
Step 1: Instantiate an SGWorld81 instance instead of an SGWorld80 instance
When you initialize the SGWorld object by calling the initSGWorld function, you have the option to automatically use the latest version of SGWorld. To do this, simply use:
var SGWorld = initSGWorld("");
If you have done it this way, no updates are required in this step.
If, however you previously used another method such as the <object> tag to create SGWorld from a specific version or specified a particular version of SGWorld using its CLSID, like this:
var SGWorld = initSGWorld("[CLSID]");
Then you will to need update to the latest version in either of the following ways:
§ By passing an empty string "" in initSGWorld to get the latest version of SGWorld:
var SGWorld = initSGWorld("");
§ By updating the CLSID to reflect the latest version, i.e., 3A4F91A1-65A8-11D5-85C1-0001023952C1.
Step 2: Fix any changes related to modified/removed properties and methods
Since there are no types in JavaScript, you only need to consult the documentation regarding what was changed between v8.1 and v8.0. Unfortunately, unlike compiled languages, you do not have the compiler help in identifying those places. See “Property and Method Changes in API v8.1” in this chapter for more details.