ESRI Geoportal Metadata Record Editor Default Map Zoom/Extent

Document Information
Document ID: 
app2011-021

The USGIN's implementation of ESRI's Geoportal has a metadata record editor.  The editor is used when adding a new metadata record to the applications database or updating an existing record.  A section of the metadata editor has a map that can be used to zoom into an location and draw a box around that location that becomes the spatial extent of the metadata record.  The default zoom level of the map shows all or most of the world's continents.  The default zoom can be changed by editing the gpt.js javascript file which is found in the www/catalog/js/v1 folder inside Geoportal's root source code folder.  To change the default zoom:

1. Using a text editor, edit www/catalog/js/v1/gpt.js.
2. Find the following line "if ((service != null) && (config.mapElementId != null))"
3. Add a new line after the opening curley-bracket "{"
4. Add the following three lines of javascript code:

var ext = new esri.geometry.Extent(-14881296.05, 1145638.02, -6075750.39, 7016001.79, new esri.SpatialReference({wkid:102100}));
this._agsMap = new esri.Map(config.mapElementId);
this._agsMap.setExtent(ext);

The coordinates in the first line are approximately the extents of the US.  Set them to whatever values you need.

5. Save the gpt.js file
6. Compile and re-deploy your application