If a you want to develop for the HTML5 viewer or embed the HTML5 viewer then it can become useful to load a viewer from one domain and a site from another.
Solution:
The viewer by default prevents load shell JS files from a domains that differ from the host where the viewer is located. IIS on the server hosting the site to be consumed also has measures in place to prevent files from being loaded from different domains.
Viewer Changes:
1. Open the GVH Index.html page and find the viewer initialization code. a. var viewer = new geocortex.essentialsHtmlViewer.ViewerApplication(viewerConfig.viewerConfigUri, null, viewerId);
2. The geocortex._configDomains object must be added before the viewer initialization. a. geocortex._configDomains = { "http://YourServer": true};
IIS changes required:
1. Ensure the correct HTTP Response Headers are entered. Access-Control-Allow-Headers: X-Requested-With Access-Control-Allow-Methods: POST,GET,OPTIONS Access-Control-Allow-Origin: http://myserverdomain
2. Check to see that there is a OPTIONSVerbHandler configured in IIS Handler Mappings.
3. Check the REST web.config for the following entry and comment it out if present - <remove name="OPTIONSVerbHandler" />
4. Restart IIS and try launching an external config file through the viewer index.html page
Comments
0 comments
Article is closed for comments.