Skip to content

Commit

Permalink
Merge pull request #5471 from camptocamp/search-action_2.3
Browse files Browse the repository at this point in the history
Additional search actions
  • Loading branch information
sbrunner committed Apr 10, 2020
2 parents 0315230 + 0729688 commit 3fe09a7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion contribs/gmf/src/search/component.js
Expand Up @@ -153,6 +153,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 @@ -170,7 +171,8 @@ exports.component_ = {
'additionalListeners': '<gmfSearchListeners',
'maxZoom': '<?gmfSearchMaxzoom',
'delay': '<?gmfSearchDelay',
'onInitCallback': '<?gmfSearchOnInit'
'onInitCallback': '<?gmfSearchOnInit',
'searchActionCallback': '&?gmfSearchAction'
},
controller: 'gmfSearchController',
templateUrl: gmfSearchTemplateUrl
Expand Down Expand Up @@ -308,6 +310,11 @@ exports.SearchController_ = class {
*/
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 @@ -980,6 +987,10 @@ exports.SearchController_ = class {
const silent = !!featureGeometry;
this.gmfTreeManager_.addGroupByLayerName(actionData, true, silent);
}
} else {
if (this.searchActionCallback) {
this.searchActionCallback(action);
}
}
}
}
Expand Down

0 comments on commit 3fe09a7

Please sign in to comment.