Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional search actions #5355

Merged
merged 3 commits into from
Jan 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion contribs/gmf/src/search/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ function gmfSearchTemplateUrl($element, $attrs, gmfSearchTemplateUrl) {
* change the style of the feature on the map. Default is false.
* @htmlAttribute {number=} gmf-search-maxzoom Optional maximum zoom we will zoom on result, default is 16.
* @htmlAttribute {function=} gmf-search-on-init Optional function called when the component is initialized.
* @htmlAttribute {function=} gmf-search-action Optional function called when no default action is defined.
* @ngdoc component
* @ngname gmfSearch
*/
Expand All @@ -198,7 +199,8 @@ const searchComponent = {
'additionalListeners': '<gmfSearchListeners',
'maxZoom': '<?gmfSearchMaxzoom',
'delay': '<?gmfSearchDelay',
'onInitCallback': '<?gmfSearchOnInit'
'onInitCallback': '<?gmfSearchOnInit',
'searchActionCallback': '&?gmfSearchAction'
},
controller: 'gmfSearchController',
templateUrl: gmfSearchTemplateUrl
Expand Down Expand Up @@ -338,6 +340,11 @@ class SearchController {
*/
this.onInitCallback;

/**
* @type {function(any): void}
*/
this.searchActionCallback;

/**
* Whether or not to show a button to clear the search text.
* Default to true.
Expand Down Expand Up @@ -993,6 +1000,10 @@ class SearchController {
const silent = !!featureGeometry;
this.gmfTreeManager_.addGroupByLayerName(actionData, true, silent);
}
} else {
if (this.searchActionCallback) {
this.searchActionCallback(action);
}
svaabs marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down