Moving QuickStart Libraries (with custom modules) to an existing Viewer (v 2.5.2)
Hello, I need some assistance.
I have the downloaded Geocortex Viewer for HTML 2.5.2. Inside the downloaded folder, there is the Viewer- a folder with a ready-to-go application that can be hosted.
I used the QuickStart solution (a separate sample ready-to-go application) to build a custom module, which in-turn created a folder called Libraries, which contains all of my custom code.
I need to know how to transfer my custom JavaScript Libraries FROM the QuickStart sample application TO any other existing GeoCortex Viewer application with the expectation that the Libraries will be found by some loading logic, and be able to be recognized in order to work.
I cannot simply replace any application with my QuickStart application- I don't have that luxury. I need to know how to integrate my Libraries with an existing Viewer solution/application so that the custom configuration can be used, and the application knows where to find and load the JavaScript for use.
I can't find documentation on how to do this. Please help!
-David
0
-
There are a few things you need to do. - Move the library into a virtual directory. At Latitude, we generally put this into a viewers virtual dicrectoy within a site. Example: Sites/<SiteName>/Viewers/<HTML5Viewer>/VirtualDirectory/Resources/Compiled/MyLibrary.js
- Edit whichever shell configs you want to load the custom library (Desktop.json.js).
- Reference the library (MyLibrary.js) in the libraries array._img_ alt="Configure the library" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907600000004GCU&feoid=Body&refid=0EM600000004YAO" _/_img_The 'id' is important. To find the library id, open the MyLibrary.js file in a text editor and look at the last line. The ID will be in the notify library downloaded method.
- Configure the module. This is likely going to be a copy paste from the QuickStarts default.json.js file. This configuration varies depending on if you have views and viewmodels associated with your module. Be sure to tell the module which library it can find the namespaces in. This is specified by 'libraryId'. _img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907600000004GCU&feoid=Body&refid=0EM600000004YAT" _/_img_
0 -
The formatting was butchered there. Please let me know if you have any further questions on how to load a library into different viewers. 0 -
Kevin,
Thanks so much for the quick reply! I will investigate and follow-up asap.
-David0 -
Kevin,
These instructions were very good and this worked flawlessly. I have to ask this though-
Is there a way to avoid having people edit this monster configuration file for an application? Are there any functions provided in the GeoCortex framework that will merge a custom configuration file I build with the active configuration file and result in a working custom module and application?
I will look myself and try to understand ViewerLoader, I think it is, a bit better, but I didn't see anything off-hand. It does seem like you can use a collection of configuration files for the same application instance, but I also have not tried that yet.0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
4 kommentarer