|
1 | 1 | #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. |
3 | 3 |
|
4 | 4 | ---
|
5 | 5 | ## Example Configuration:
|
@@ -39,6 +39,59 @@ define([
|
39 | 39 | map: true,
|
40 | 40 | mapClickMode: true,
|
41 | 41 |
|
| 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 | + |
42 | 95 | layers: [
|
43 | 96 | {
|
44 | 97 | name: 'Damage Assessment',
|
@@ -302,3 +355,46 @@ define([
|
302 | 355 |
|
303 | 356 | ## Screenshot:
|
304 | 357 | 
|
| 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