This repository has been archived by the owner on May 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Feature Grid Plugin
Andrea edited this page Jul 16, 2015
·
23 revisions
In order to use the FeatureGrid plugin in MapStore you need to be sure that the files below are included in the buildjs.cfg file:
gxp/src/script/plugins/FeatureManager.js
gxp/src/script/plugins/ClickableFeatures.js
gxp/src/script/widgets/grid/FeatureGrid.js
gxp/src/script/plugins/FeatureGrid.js
in addition to those required for Spatial Selector QueryForm
NOTE: In the default configuration this is already done.
##Plugin Description
Plugin for displaying vector features in a grid with paging. You have also the possibility to export data in CSV format.
##Configuration Example
Below the plugin configuration, the following script import must be uncommented in the composer.html file:
<!-- Externals OpenLayers libraries -->
<script type="text/javascript" src="script/OpenLayersExt.js"></script>
Then you have to specify a valid plugin configuration, such as:
...
"customPanels":[
...
{
"xtype": "panel",
"title": "FeatureGrid",
"border": false,
"id": "south",
"region": "south",
"layout": "fit",
"height": 330,
"collapsed": false,
"collapsible": true,
"header": true
},
{
"xtype": "panel",
"title": "Query Panel",
"border": false,
"id": "east",
"width": 400,
"height": 500,
"region": "east",
"layout": "fit",
"collapsed": false,
"collapsible": true,
"header": true
}
...
],
...
"customTools":[
...
{
"ptype": "gxp_featuremanager",
"id": "featuremanager",
"pagingType": 1
}, {
"ptype": "gxp_featuregrid",
"featureManager": "featuremanager",
"outputConfig": {
"id": "featuregrid",
"title": "Features"
},
"outputTarget": "south",
"exportFormats": ["CSV","shape-zip"]
}, {
"ptype": "gxp_spatialqueryform",
"featureManager": "featuremanager",
"featureGridContainer": "south",
"outputTarget": "east",
"showSelectionSummary": true,
"actions": null,
"id": "bboxquery",
"outputConfig":{
"outputSRS": "EPSG:900913"
},
"spatialSelectorsConfig":{
"bbox":{
"xtype": "gxp_spatial_bbox_selector"
},
"buffer":{
"xtype": "gxp_spatial_buffer_selector"
},
"circle":{
"xtype": "gxp_spatial_circle_selector",
"zoomToCurrentExtent": true
},
"polygon":{
"xtype": "gxp_spatial_polygon_selector"
}
}
}
...
]
...
-
"ptype"
: ptype of the plugin -
"featureManager"
: The id of the :class:gxp.plugins.FeatureManager
to use with this tool -
"outputConfig"
:-
"id"
: id of the plugin -
"title"
: title of grid panel
-
-
"outputTarget"
: id of the panel where this grid is added -
"showExportCSV"
: set to true to enable grid data in CSV format (default to false). Deprecated. Use instead exportFormats = ["CSV"]. -
"exportFormats"
:Array
With the available export formats. For example:["CSV","shape-zip","excel", "excel2007"]
.
If"exportFormats"
is omitted, the export button will not be displayed. -
"exportAction"
: Export action type. It can bebutton
(append one button for each export format) orwindow
(append only one buttonExport
and show options in a new window). Default iswindow
. -
"defaultComboFormatValue"
: Default output format selection for export (for exportAction ==window
). Default is 'CSV'. -
"exportFormatsConfig"
: (optional) Specific configuration by export format. The default one include a valid configuration for shp-zip export (this format requires the geometry property) -
"showNumberOfRecords"
: (optional) Default to false. When tha value of this property is true, shows the total number of records availables (this requires that the featureManager.pagingType is setted to 1 that means standard WFS paging). -
"featureMaxZoomLevel"
: (optional) When the value of this property is set, this determines the maximum zoom level when we zoom to feature