Embed the Geoportal Search Widget for HTML in Another Page |
|
Release 9.3.1 |
The Geoportal Search Widget for HTML can easily be included in other web pages or applications to enable searching the Geoportal. Users can type a search term or lucene search query in the search field, and retrieve a pop-up list of records that match that search. To see an example, access the geoportal's widget examples page, and enter a search term in the HTML widget interface that displays.
Search widget that appears on web page:
Pop-up window displaying search results:
How to Configure
Installing the Geoportal Search Widget for HTML consists of copying two lines of code and pasting it into the HTML page where you want the widget to appear. The first line of code references the JavaScript API that contains required tools for the search widget. The second line of code references the Geoportal catalog and provides the medium for searching. In the second line of code, replace "server_name" with your organization's Geoportal server.
<!-- Catalog Search Widget -->
<script type="text/javascript"
src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.3"></script>
<script type="text/javascript"
src="http://server_name/geoportal/widgets/searchjs.jsp"></script>
Additional Installation Options
If you want the search widget to show only certain search results when a user interacts with it, it is possible to customize the widget url to filter the search. Supported search filters are:
http://server_name/geoportal/widgets/searchjs.jsp?anchor=link&max=10
http://server_name/geoportal/widgets/searchjs.jsp?bbox=-79.71068%2C36.989765%2C-74.81832%2C40.659035&spatialRel=esriSpatialRelWithin