String representing the current author or user.
Object.defineProperty(RunSettings.prototype, 'author',
get: function(),
set: function(value)
)
A string
. The default value is an empty string
.
This property will be used throughout LEADVIEW (mostly for annotations). Annotation objects/reviews that are created by the user are tagged with the provided name.
export class RunSettingsExample {
public constructor() {
if(lt.RasterSupport.kernelExpired)
lt.RasterSupport.setLicenseUri("https://demo.leadtools.com/licenses/js/LEADTOOLSEVAL.txt", "EVAL", null);
}
public run = (divID: string): void => {
const lv = new lt.LEADVIEW.Viewer();
const runSettings: lt.LEADVIEW.RunSettings = {
logger: this.createLogger(),
author: "Demo Author"
}
// A quick test to make sure the logger was injected successfully is to change the 'rootDivId' to an invalid ID
// This will throw a LEADVIEW creation error, which will be bubbled up to the logApplicationError Logger method.
lv.run(runSettings, {
'rootDivId': divID
});
}
private createLogger = ():lt.LEADVIEW.ILogger => {
const logger: lt.LEADVIEW.ILogger = {
logApplicationError: (errorType: lt.LEADVIEW.ErrorType, message:string) =>{
alert(`Application Error:\nType:${errorType}\nMessage:${message}`);
},
logServiceError: (serviceError: lt.Document.ServiceError, defaultMessage?: string) => {
alert(`Service Error:\nType:${serviceError.code}\nMessage:${serviceError.message}`);
return serviceError.message;
}
};
return logger;
}
}