Module load order
I have created a custom module to display the elevation as the user moves the mouse on the map. I am running into an issue where my module will load at various times and when it loads early it won't run the code. I have it loading in the bottom left footer region. When it works it loads after the coordinates and scalebar modules have loaed and when it doesn't work it seems to load the view before the other modules in the region.
Is there anyway for me to force or check that it can load before it does so that it always responds as desired?
Regards,
Marc
-
I think I have solved my problem. I watched the Deep Dive video http://support.geocortex.com/guc-2013-d1-tt-s3
Toward the end it showed how to add a site initialzed check to the ViewModel.ts file. It will check if the site has been initialized and if not subscribe to the SiteInitializedEvent.
initialize(config: any): void {
var site: geocortex.essentials.Site = (<any>this).app.site;if (site && site.isInitialized) {
this._onSiteInitialized(site);
}
else {
this.app.eventRegistry.event("SiteInitializedEvent").subscribe(this, (args) => {
this._onSiteInitialized(args);
});
} }_onSiteInitialized(site: geocortex.essentials.Site) {
MODULE CODE GOES HERE
}
Hope that helps someone else down the line.
Marc
0
Please sign in to leave a comment.
Comments
1 comment