cgxp.plugins.FeaturesWindow

ptype
cgxp_featureswindow
class cgxp.plugins.FeaturesWindow(config)

This plugin shows query results in a window (popup) using a grouping grid.

This plugin should receive the list of themes in its config. This is to read the “identifier attribute” from the layer spec.

For the queryable Base layer the identifierAttribute can be provide by the queryLayers option in a layer config:

...
queryLayers: [{
    name: "buildings",
    identifierAttribute: "name"
}, {
    name: "parcels",
    identifierAttribute: "number"
}]
...

Example Use

Sample code showing how to add a FeaturesWindow plugin to a gxp.Viewer:

var obs = new Ext.util.Observable();

new gxp.Viewer({
    ...
    tools: [{
        ptype: "cgxp_featureswindow",
        id: "featuresProvider",
        themes: THEMES,
        events: EVENTS
    }, {
        ptype: "cgxp_wmsgetfeatureinfo",
        actionTarget: "center.tbar",
        toggleGroup: "maptools",
        events: EVENTS
    }]
    ...
});

Config Options

Configuration properties.

defaultStyle

Object A style properties object to be used to show all features on the map (optional).

Set label to null to hide labels.

Defaults to { fillColor: 'red', strokeColor: 'red' }.

events

Ext.util.Observable An Ext.util.Observable instance used to receive events from other plugins.

  • queryopen: sent on open query tool.
  • queryclose: sent on closequery tool.
  • querystarts: sent when the query button is pressed
  • nolayer: sent when no layer to query.
  • queryresults(queryresult): sent when the result is received
highlightStyle

Object A style properties object to be used to show features on the map when hovering the row in the grid (optional).

Set label to null to hide labels.

Defaults to { fillColor: 'red', strokeColor: 'red', fillOpacity: 0.6, strokeOpacity: 1, strokeWidth: 2 }.

itemsText

String Text for the “number of items” label (plural) (i18n).

itemText

String Text for the “number of items” label (singular) (i18n).

loadingResults

String Loading results message (i18n).

messageStyle

String CSS style used for the queryResult message.

noFeatureFound

String No feature found notice message (i18n).

noLayerSelectedMessage

String No layer selected message (i18n).

openFeatures

Number number of query results that will be expand in the grid when loaded, default is 1.

showUnqueriedLayers

Bool show or hide the unqueried layers in the tabpanel, default is true.

suggestionText

String Text for the shortened notice message (i18n).

themes

Object List of internal and external themes and layers. (The same object as passed to the cgxp.plugins.LayerTree).

windowOptions

Object Additional options given to the window constructor.

windowTitleText

String Text for the window title (i18n).

Public Methods

Public methods.

FeaturesWindow.getDetail()

Create the details view of a feature, Override this to change the details view :arg feature: Object feature

FeaturesWindow.onRowExpand()

Called when a row is expanded. Do nothing by default. :arg expander: Object RowExpander object :arg record: Ext.data.Record Record for the selected row :arg body: Object Body element for the secondary row :arg rowIndex: Integer The current row index

Table Of Contents

Previous topic

cgxp.plugins.FeaturesResult

Next topic

cgxp.plugins.FloorSlider

This Page

Fork me on GitHub