Feature Actions released at 2.1 issue

1852
5
07-27-2016 05:53 PM
RodWoodfordOld
Occasional Contributor III

Hi

How do I control the Feature Actions released in 2.1. I want to be able to modified, add or remove them from apps as required. Basically the statistics can be misleading in some apps and I would like to hide access or modify the results if possible. Any advice would be useful.

cheers

Rod

Tags (1)
0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Rod,

  There is no configuration option for this but you can edit the jimu/popupmanager.js in the _initPopupMenu function you can check for you layer and then remove actions you don't want to see for that particular layer.

RodWoodfordOld
Occasional Contributor III

cheers, I'll give it ago.

Rod

0 Kudos
RodWoodfordOld
Occasional Contributor III

Hi Robert,

I have looked at this file but cant find any layers to amend. Can you provide more info. Am I looking at the correct file?

\server\apps\**\jimu.js\popupmanager.js

_initPopupMenu: function(){
        this.featureActionManager.getSupportedActions(this.selectedFeature).then(lang.hitch(this, function(actions){
          var popupActions = actions.filter(lang.hitch(this, function(action){
            return ['ZoomTo', 'ShowPopup', 'Flash'].indexOf(action.name) < 0 ;
          }));

          if(popupActions.length === 0){
            html.addClass(this.popupMenuButtonDesktop, 'disabled');
            html.addClass(this.popupMenuButtonMobile, 'disabled');
          }else{
            html.removeClass(this.popupMenuButtonDesktop, 'disabled');
            html.removeClass(this.popupMenuButtonMobile, 'disabled');
          }
          var menuActions = popupActions.map(lang.hitch(this, function(action){
            action.data = jimuUtils.toFeatureSet(this.selectedFeature);
            return action;
          }));
          this.popupMenu.setActions(menuActions);
        }));
      },

cheers

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rod,

Sorry, I should have explained more. You can use this.selectedFeature.getLayer() to get the layer that the popup is dealing with and then check the title or id of that layer to see if it is your layer of interest.

JeremyWolff
New Contributor II

Hi,

Have you found a way to disable a feature action like Statistics?

Cheers,

Jeremy

0 Kudos