Skip to content

Map Viewer

leigpt edited this page Jun 27, 2013 · 28 revisions

An external map viewing application is not necessary for full geoportal functionality, as live services can be readily viewed from the built-in previewer that comes with the geoportal. However, if your organization would like to implement a map viewing application, the geoportal can be configured to support your viewer. However, you may need to write a class in order to add your custom map viewer. Currently the geoportal has the class to support Add to Map functionality for the Flex based map viewer. This allows users to see an Add to Map link for live services search results, and launch the service in the Flex based Map Viewer. The instructions to configure the link to launch the map viewer and the Add to Map functionality are described below. For instructions on how to add the Geoportal Search Widget to your existing Flex or Silverlight map viewer, see instructions in the Search Widget for Flex or Search Widget for Silverlight topics.

By adding this map viewer link into the gpt.xml file it will expose an Add to Map link for a search result on the search page and a link labeled Launch Map Viewer on your geoportal main menu. The Add to Map functionality depends on the implementation of the supporting class. For example out of the box, there is a class called com.esri.gpt.catalog.search.MapViewerFlex which supports adding ArcIMS, ArcGIS Server REST services, OGC WMS, and GeoRSS to a Flex based map viewer application. The steps below describe how to enable this functionality.

  1. Open the gpt.xml file.
  2. Find the instance URL attribute of the <mapviewer></mapviewer> element.
  3. Input the URL to your map viewer application in the instance URL element. See Example 1 below.
  4. If you want to adjust the width, height, or additional file formats and you are using the FlexMapViewer class, then update the following attributes.
    • width: width of the map viewer application (particular to the FlexMapViewer class)
    • height: height of the map viewer application (particular to the FlexMapViewer class)
    • regexCanConsumeUrl: regular expression to enable the Add to Map link for other file formats (particular to the FlexMapViewer class). Additional formats would require some customization. See Example 2 below.
  5. Save the gpt.xml file.
  6. Restart the geoportal web application.
Example 1 below uses a Flex based map viewer. The className attribute must be in the same domain and port in order for layering of resources to work.
<mapviewer>
  <instance url="[URL to your flex viewer's index.jsp file]"
   className="com.esri.gpt.catalog.search.MapViewerFlex">
    <parameter key="width" value="1000"/>
    <parameter key="height" value="700"/>
    <parameter key="regexCanConsumeUrl" value=""/>
  </instance>
</mapViewer>

Example 2 shows how to complete the regular expression section for regexCanConsumeUrl if you want to customize additional format:
<parameter key="regexCanConsumeUrl" value="*.zip|*.rar"/>
Clone this wiki locally