Overview:
Some users who have configured custom viewer modules have reported problems following an upgrade to GVH 2.8. A change made to GVH viewer configuration introduced a new “require” statement that is used to determine which source file contains the module implementation. If the “require” statement is missing, the viewer may not be able to locate the code for the module, and will not load properly.
Solution:
Some users who have configured custom viewer modules have reported problems following an upgrade to GVH 2.8. A change made to GVH viewer configuration introduced a new “require” statement that is used to determine which source file contains the module implementation. If the “require” statement is missing, the viewer may not be able to locate the code for the module, and will not load properly.
In GVH, we use namespaces to sort objects in the viewer configuration into collections of objects. This makes them easier to work with. An example would be:
In 2.8, we have changed our namespaces to allow you to load them asynchronously. These new Asynchronous module definition (AMD) namespaces are what you need to “require” in your viewer configuration file.
To make this easier, we have compiled a list of the legacy namespaces, and their corresponding AMD namespaces That list can be found here.
Consider the following example from two sections of a viewer configuration file:
In the example below, you can see a custom module for the footer (FooterMenuView, and FooterMenuViewModel). These views and view models reference the following legacy namespaces:
Some users who have configured custom viewer modules have reported problems following an upgrade to GVH 2.8. A change made to GVH viewer configuration introduced a new “require” statement that is used to determine which source file contains the module implementation. If the “require” statement is missing, the viewer may not be able to locate the code for the module, and will not load properly.
Solution:
Some users who have configured custom viewer modules have reported problems following an upgrade to GVH 2.8. A change made to GVH viewer configuration introduced a new “require” statement that is used to determine which source file contains the module implementation. If the “require” statement is missing, the viewer may not be able to locate the code for the module, and will not load properly.
In GVH, we use namespaces to sort objects in the viewer configuration into collections of objects. This makes them easier to work with. An example would be:
?"type": "geocortex.essentialsHtmlViewer.mapping.modules.geolocate.GeolocateViewModel",This type is the GeolocateViewModel, which is the child of the Geolocate namespace, which is the child of the modules namespace (and so on). The namespaces contain collections of objects that can be reused, and re-referenced as needed. You can find the contents of these namespaces here, or in section 22.4 of the HTML5 viewer administrator guide.
In 2.8, we have changed our namespaces to allow you to load them asynchronously. These new Asynchronous module definition (AMD) namespaces are what you need to “require” in your viewer configuration file.
To make this easier, we have compiled a list of the legacy namespaces, and their corresponding AMD namespaces That list can be found here.
Consider the following example from two sections of a viewer configuration file:
{ "id": "FooterMenuView", "viewModelId": "FooterMenuViewModel", "libraryId": "Mapping.Infrastructure", "type": "geocortex.essentialsHtmlViewer.mapping.infrastructure.menus.MenuView", "markup": "Mapping/infrastructure/menus/MenuHyperlinkView.html", "region": "RightFooterRegion", "visible": true, "configuration": { "menuId": "FooterMenu" } }
{ "id": "FooterMenuViewModel", "type": "geocortex.essentialsHtmlViewer.mapping.infrastructure.menus.MenuViewModel", "configuration": {} }Note the italicized lines, where you can see the types these IDs are referencing.
In the example below, you can see a custom module for the footer (FooterMenuView, and FooterMenuViewModel). These views and view models reference the following legacy namespaces:
- geocortex.essentialsHtmlViewer.mapping.infrastructure.menus.MenuView
- geocortex.essentialsHtmlViewer.mapping.infrastructure.menus.MenuViewModel
- "require": "geocortex/infrastructure/menus/MenuView",
- "require": "geocortex/infrastructure/menus/MenuViewModel",
{ "id": "FooterMenuView", "viewModelId": "FooterMenuViewModel", "libraryId": "Mapping.Infrastructure", "type": "geocortex.essentialsHtmlViewer.mapping.infrastructure.menus.MenuView", "require": "geocortex/infrastructure/menus/MenuView", "markup": "Mapping/infrastructure/menus/MenuHyperlinkView.html", "region": "RightFooterRegion", "visible": true, "configuration": { "menuId": "FooterMenu" } }
{ "id": "FooterMenuViewModel", "type": "geocortex.essentialsHtmlViewer.mapping.infrastructure.menus.MenuViewModel", "require": "geocortex/infrastructure/menus/MenuViewModel", "configuration": {} }Note the italicized lines indicating the new additions to the file. These entries follow the corresponding "type" line.
Comments
0 comments
Article is closed for comments.