Skip to content

Commit c600a1f

Browse files
committed
Update the README for the Search and Attributes Table widgets
to reflect new functionality.
1 parent d3a609c commit c600a1f

File tree

2 files changed

+120
-4
lines changed

2 files changed

+120
-4
lines changed

widgets/AttributesTable/README.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ queryOptions:
182182
*/
183183
where: '1=1',
184184

185+
/*
186+
Whether the results should be added to existing results or clear them first
187+
*/
188+
addToExisting: null,
189+
185190
/*
186191
The geometry to apply to the spatial filter.
187192
*/
@@ -753,8 +758,8 @@ The Attribute Table publishes the following topics. The topicID should be unique
753758
// publishes to the central error handler when an unexpected error occurs
754759
'viewer/handleError'
755760

756-
// publishes to the central pane management to open/close the pane containing the Attribute Table
757-
'viewer/togglePane'
761+
// published when a table is updated in some way.
762+
topicID + '/tableUpdated'
758763

759764
// publishes the raw results of the QueryTask
760765
topicID + '/queryResults'
@@ -784,6 +789,15 @@ topicID + '/addTab'
784789

785790
// remove a tab from the tab strip
786791
topicID + '/removeTab'
792+
793+
// select a tab in the tab strip
794+
topicID + '/selectTab'
795+
796+
// open the associated sidebar pane if it exists
797+
topicID + '/openPane'
798+
799+
// open the associated sidebar pane if it exists
800+
topicID + '/closePane'
787801
```
788802

789803
### Published Topics
@@ -794,4 +808,10 @@ topicID + '/tableAdded'
794808

795809
// published when a table is removed. returns the id of the table removed.
796810
topicID + '/tableRemoved'
797-
```
811+
812+
// published when a table is updated in some way.
813+
topicID + '/tableUpdated'
814+
815+
// publishes to the central pane management to open/close the pane containing the Attribute Table
816+
'viewer/togglePane'
817+
```

widgets/Search/README.md

+97-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Search Widget for CMV
2-
Used in conjunction with the [Attribute Table](https://github.com/tmcgee/cmv-widgets#attributes-tables) widget to provide a user interface for querying feature layers, dynamic layers, tables and related records using QueryTask and FindTask.
2+
Used in conjunction with the [Attributes Table](https://github.com/tmcgee/cmv-widgets#attributes-tables) widget to provide a user interface for querying feature layers, dynamic layers, tables and related records using QueryTask and FindTask.
33

44
---
55
## Example Configuration:
@@ -39,6 +39,59 @@ define([
3939
map: true,
4040
mapClickMode: true,
4141

42+
/*
43+
Show button to open the Query Builder widget
44+
This new widget not yet been released
45+
*/
46+
enableQueryBuilder: false,
47+
48+
/*
49+
continue adding multiple shapes before searching
50+
*/
51+
enableDrawMultipleShapes: true,
52+
53+
/*
54+
add the results of a search to the existing results from a previous search
55+
*/
56+
enableAddToExistingResults: true,
57+
58+
/*
59+
use spatial filters in searches by attribute
60+
*/
61+
enableSpatialFilters: true,
62+
63+
/*
64+
control which spatial filters are available
65+
*/
66+
spatialFilters: {
67+
entireMap: true,
68+
currentExtent: true,
69+
identifiedFeature: true,
70+
searchFeatures: true,
71+
searchSelected: true,
72+
searchSource: true,
73+
searchBuffer: true
74+
},
75+
76+
/*
77+
Control which drawing tools are available to the user
78+
*/
79+
drawingOptions: {
80+
rectangle: true,
81+
circle: true,
82+
point: true,
83+
polyline: true,
84+
freehandPolyline: true,
85+
polygon: true,
86+
freehandPolygon: true,
87+
stopDrawing: true,
88+
identifiedFeature: true,
89+
selectedFeatures: true,
90+
91+
// change the symbology for drawn shapes and buffer around them
92+
symbols: {}
93+
},
94+
4295
layers: [
4396
{
4497
name: 'Damage Assessment',
@@ -302,3 +355,46 @@ define([
302355

303356
## Screenshot:
304357
![Screenshot](https://tmcgee.github.io/cmv-widgets/images/search2.jpg)
358+
359+
---
360+
##Search Topics
361+
362+
### Subscribed Topics
363+
The Search widget subscribes to the following topics. The topicID should be unique for each instance of the widget.
364+
``` javascript
365+
// execute a basic search (incomplete and untested)
366+
topicID + '/search'
367+
368+
// execute a query
369+
topicID + '/executeQuery'
370+
371+
// update the available spatial filters when the table (tab) is updated
372+
this.attributesContainerID + '/tableUpdated'
373+
374+
// set the sql where clause for the current attributes search
375+
this.topicID + '/setSQLWhereClause'
376+
377+
this.topicID + '/clearSQLWhereClause'
378+
379+
// listens for the mapClickMode changing
380+
'mapClickMode/currentSet'
381+
```
382+
383+
### Published Topics
384+
The Search widdet publishes the following topics. The topicID should be unique for each instance of the widget.
385+
```javascript
386+
// publishes to Growl widget to provide users with information such as when a query is executing or details about the query results (number of results)
387+
'growler/growl'
388+
389+
// publish a change in mapClickMode
390+
'mapClickMode/setCurrent'
391+
392+
// return the mapClickMode to the default
393+
'mapClickMode/setDefault'
394+
395+
// publish to an accompanying attributes table and running the submitted query or find task.
396+
this.attributesContainerID + '/addTable'
397+
398+
// opens the QueryBuilder widget
399+
this.queryBuilderTopicID + '/openDialog'
400+
```

0 commit comments

Comments
 (0)