Loading an Imagery Layer Asynchronously

This sample demonstrates how to load an imagery layer asynchronously using the ICreator81.CreateImageryLayerAsync method, with success and failure handled through the ITerraExplorerAsync81 OnReject and OnResolve methods.

 

SGWorld.Creator.CreateImageryLayerAsync("D:\\AirPhoto.tif", 0, 0, 0, 0,"", "gdlplg.rct", "", "RasterLayer").OnResolve(function(layer){alert(layer.TreeItem.Name + " was loaded successfully")}).OnReject(function(error){alert("layer was not loaded")});