Initializes and builds the Viewer.
runSettings
The RunSettings to use.
settings
Application settings for LEADVIEW.
The run method initializes and builds the Viewer as follows:
LEADVIEW.json
file. If this file does not exist, then LEADVIEW creates it with default settings.startupSettings
key. It should contain the URI to the startup settings file to use.LEADVIEW.json
file, or if the resource can not be retrieved, LEADVIEW creates it with default settings.After LEADVIEW retrieves the base settings, the following checks are performed:
LEADVIEW checks if the user settings are saved to Local Storage. If so, these settings are pulled and merged with the application's base settings.
To prevent a user's Local Storage settings from over-riding the base setting, simply change the modifiable
property value to false in the settings' json file. This will also prevent the user from being able to manipulate or see the settings in the Settings Dialog.
Any settings provided to the run method are then merged.
So in summary, settings are passed in the following manner: run method > local storage settings > base application settings.
After the settings have been resolved, LEADVIEW then builds and injects itself into the DOM, based off of the creation ID provided in the settings.
export class ViewerRunExample {
public constructor() {
if(lt.RasterSupport.kernelExpired)
lt.RasterSupport.setLicenseUri("https://demo.leadtools.com/licenses/v200/LEADTOOLSEVAL.txt", "EVAL", null);
}
public run = (divID: string): void => {
const lv = new lt.LEADVIEW.Viewer();
// Builds a new instance of LEADVIEW.
// For the full list of options that can be passed to the run method,
// refer to the settings JSON files that are included in the LEADVIEW demo application.
// Settings files can also be generated from the LEADVIEW application itself.
lv.run(null, {
'rootDivId': divID
});
}
}