How to call Feature Actions from popup/infoWindow?

928
2
Jump to solution
05-09-2017 06:48 AM
BenedekSimó
New Contributor III

I have successfully inserted a link in a popup window, like this. Now how can I call a Feature action (Export to CSV, View in Attribute Table, etc.) on a click on that link?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Benedek,

   It is as simple as calling code like this from your function:

var feature = this.mapManager.map.infoWindow.getSelectedFeature();
var fs = {features:[feature]};
var csvAct = FeatureActionManager.getInstance().getActionsByActionName("ExportToCSV")[0];
csvAct.onExecute(fs);

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Benedek,

   It is as simple as calling code like this from your function:

var feature = this.mapManager.map.infoWindow.getSelectedFeature();
var fs = {features:[feature]};
var csvAct = FeatureActionManager.getInstance().getActionsByActionName("ExportToCSV")[0];
csvAct.onExecute(fs);
BenedekSimó
New Contributor III

Thank you, Robert!

0 Kudos