GMAF Custom Development

Prior versions of the Geocortex Viewer for HTML5 referenced the online Esri ArcGIS API for JavaScript. As of version 2.5, the HTML5 Viewer also includes a partial copy of the ArcGIS API for JavaScript. When the geocortexUseLocalEsriApi variable in Index.html, Tablet.html or Handheld.html is set to true, the viewer switches from using the online API to the local copy. These files are located in the root folder of where the HTML5 Viewer is installed. The Geocortex Mobile App Framework requires the local copy of the ArcGIS API to function. By default, viewers downloaded by the Geocortex Mobile App Framework have this variable set to true.

If you engage in custom development, it is important to copy any necessary ArcGIS API files that you use to your local copy, in one of the following folders within the HTML5 Viewer folder as appropriate:

If you do not, your viewer application may work in a web browser when referencing the online ArcGIS API, but fail when referencing the local copy, as the Geocortex Mobile App Framework does.

We recommend you set the geocortexUseLocalEsriApi variable to true when testing your custom development so that missing files will be reported in your web browser console. This will help to ensure your application will work in the Geocortex Mobile App Framework.

Within Index.html, Tablet.html and Handheld.html, you can simply uncomment the line that reads //var geocortexUseLocalEsriApi = true; by removing the two preceding forward slashes to set the variable.

For example, after setting the geocortexUseLocalEsriApi variable to true, suppose your web browser console indicates dijit/tree/TreeStoreModel.js is missing. Download the file from http://js.arcgis.com/3.34/dijit/tree/TreeStoreModel.js and save it to Resources/Scripts/dijit/tree/TreeStoreModel.js within your HTML5 Viewer folder.

For more information about custom development, see Extend the Geocortex Viewer for HTML5.