Heron

Table Of Contents

Previous topic

Heron.widgets.search.FeatureGridPanel

Next topic

Heron.widgets.search.FeatureInfoPopup

Heron.widgets.search.FeatureInfoPanel

Extends
xtype
hr_featureinfopanel
class Heron.widgets.search.FeatureInfoPanel(config)

A Panel designed to hold WMS GetFeatureInfo (GFI) data for one or more WMS layers.

Example Use

Sample code showing how to configure a Heron FeatureInfoPanel. All regular ExtJS Ext.Panel config params also apply. The infoFormat config parameter is the default INFO_FORMAT to be used for WMS GetFeatureInfo (GFI). This value can be overruled by an optional per-Layer infoFormat WMS Layer config parameter. GetFeatureInfo-response data may be displayed as a Grid, a Tree or formatted XML. The displayPanels config option can be used to trigger a menu with display options. Note also the use of “GridCellRenderers”. These allow you to render specific formatting of cell content within the feature grid. For example URL substitution to render external links in a new tab or browser window. You can even supply your own formatting function. This function is according to the ExtJS ColumnModel renderers (see e.g. http://snipplr.com/view/40942).

      {
        xtype: 'hr_featureinfopanel',
        id: 'hr-feature-info',
        region: "south",
        border: true,
        collapsible: true,
        collapsed: true,
        height: 205,
        split: true,
        infoFormat: 'application/vnd.ogc.gml',
        displayPanels: ['Grid', 'XML'],
        exportFormats: ['CSV', 'XLS'],
        maxFeatures: 10,
        discardStylesForDups: true,
        gridCellRenderers: [
                               {
                                       featureType: 'cities',
                                       attrName: 'City',
                                       renderer: {
                                               fn : Heron.widgets.GridCellRenderer.directLink,
                                               options : {
                                                       url: 'http://en.wikipedia.org/wiki/{City}',
                                                       target: '_new'
                                               }
                                       }
                               },
                               {
                                       featureType: 'cities',
                                       attrName : 'Country',
                                       renderer :  {
                                               fn : Heron.widgets.GridCellRenderer.browserPopupLink,
                                               options : {
                                                       url: 'http://en.wikipedia.org/wiki/{Country}',
                                                       winName: 'demoWin',
                                                       width: 400,
                                                       height: 800,
                                                       scrollbars: 'yes'
                                               }
                                       }
                               },
                               {   // Example for custom HTML, could use also with e.g. links
                                       featureType: 'cities',
                                       attrName : 'longitude',
                                       renderer :  {
                                               fn : Heron.widgets.GridCellRenderer.valueSubstitutor,
                                               options : {
                                                       template: '<i>ll={latitude},{longitude}{empty}</i>'
                                               }
                                       }
                               },
                               {
                                       // Example: supply your own function, parms as in ExtJS ColumnModel
                                       featureType: 'cities',
                                       attrName : 'population',
                                       renderer :  {
                                               fn : function(value, metaData, record, rowIndex, colIndex, store) {
                                                       // Custom formatting, may also use this.options if needed
                                                       return '<b>' + value + ' inh.</b>';
                                               },
                                               options : {

                                               }
                                       }
                               }

}

Config Options

Configuration properties in addition to those listed for Ext.Panel.

discardStylesForDups

Boolean In case the same Layer is present multiple times, request only once without any STYLES= parameter. Default is false.

displayPanels

String Array

tring array of types of Panels to display GFI info in, default value is [‘Grid’], a grid table. Other values are ‘XML’ and ‘Tree’. f multiple display values are given a menu will be shown to switch display types.

drillDown

Boolean Show features from all visible layers that are queryable.

exportFormats

String Array

rray of document formats to be used when exporting the content of a GFI response. This requires the server-side CGI script heron.cgi` to be installed. Exporting results in a download of a document with the contents of the (Grid) Panel. or example when ‘XLS’ is configured, exporting will result in the Excel (or compatible) program to be tarted with the GFI data in an Excel worksheet. ption values are ‘CSV’ and/or ‘XLS’, default is, null, meaning no export (results in no export menu). he value [‘CSV’, ‘XLS’] configures a menu to choose from a .csv or .xls export document format.

hover

Boolean Show features on hovering.

infoFormat

String Default GFI INFO_FORMAT parameter, may be overruled per Layer object infoFormat WMS param. If not set the value application/vnd.ogc.gml will be used.

layer

string The layer to get feature information from. Parameter value will be "" if not set. If not set, all visible layers of the map will be searched. In case the drillDown parameter is false, the topmost visible layer will searched.

maxFeatures

int Default GFI MAX_FEATURES parameter. Will be 5 if not set.