Search Map
Customize the Search Map
The search map is referenced in the \\geoportal\WEB-INF\classes\gpt\config\gpt.xml file. It is called up on the interface by the ArcGIS Server JavaScript API. To change the search map itself, simply reference a new service URL in the mapServiceUrl attribute of the <interactiveMap> tag in the gpt.xml file. This topic addresses important things to keep in mind if you change the search map service and how to change the dimensions of the search map.
Important things to remember if you change the search map service
Make sure that the search map service you use considers the following:
- The URL specified in the mapServiceUrl parameter must be a REST URL. It cannot be a SOAP URL.
- Projected services are supported, but with consequences. As the metadata document envelopes and searches are based upon opposing geographic coordinate system coordinates, the opposing corners cannot be drawn in a projected rectangle. This will cause instances where the search results do not match the visible criteria. In order to use a projected service, the geometryServiceUrl attribute has to be set on the <interactiveMap> tag.
- The mapServiceType parameter should be set to dynamic, even if you are referencing a tiled service. This is a known limitation. Specifying tiled in this parameter will result in navigation problems on the search map.
- Do not use map services with spatial reference not defined using a well-known ID (WKID). Because the search map is based on the JavaScript API, limitations for the JavaScript API will apply to the search map. There is a known issue with the JavaScript API only supporting coordinate systems defined by a WKID. It is possible for the spatial reference of a map to also be defined as a definition string (WKT), but this will result in odd behaviors in the search map. For example, you may not see a footprint of the metadata records on the search page, you may not be able to define envelope for the metadata created/edited on the Create Metadata form, and Preview will fail for displaying 'graphical' services such as GeoRSS or KML/KMZ.
- If you plan to use a map service for your search map that uses a coordinate system other than WGS 1984 - EPSG 4326, then you may have to set the jsapiUrl parameter in the gpt.xml file to reference the version 1.6 JavaScript API instead of the default version 2.0.
Change the Search Map Dimensions
If you change the default search map that appears on the search page, you may have to change the dimensions of the map container itself to better suit your geographic area. The code for the search page can be found in the \\geoportal\catalog\search\criteria.jsp file.
- Open the \\geoportal\catalog\search\criteria.jsp file in a text editor.
- Navigate to the div that has an id of interactiveMap.
- The div has an associated width and height specified in its style attribute. Change the width and height values as needed.
- The div that holds the interactiveMap has a parent div that creates the border around the map. If you change the dimensions of the child div, you must also update the dimensions of this parent div. Locate the div declaration immediately above the interactiveMap div. Change the width and height values of the style attribute as needed.
- An example where the height and width are changed to
537 pixels and 360 pixels respectively is shown below:
<f:verbatim> <div id="locatorCandidates" class="locatorCandidates"></div> <div style="width: 537px; height: 360px; margin-top: 1px; border: 1px solid #000000;"> <div id="interactiveMap" dojotype="dijit.layout.ContentPane" style="width:537px; height:360px; cursor:pointer; cursor:pointer;"></div> </div> </f:verbatim>
- It is also important to change the width of the
Geoportal page size to accomodate your larger map. To change the
width, open the preview.css from the
\\geoportal\catalog\skins\themes\[color theme] folder. In that
file, increase the size of page by adjusting the width value. In the example below, the width is increased from 880px to 980px:
div#gptMainWrap { width: 980px;
- Save the altered files, restart the geoportal web application, and open a new browser window for your Geoportal to see the change in effect.