Select to view content in your preferred language

Feature Effect and Labeling issue

1473
5
Jump to solution
12-31-2021 04:31 AM
LuisAntonioRodriguezGonzalez
Emerging Contributor

ArcGIS API for JavaScript 4.22

I have a web app that apply Feature Effect and Labeling on a Feature Layer.

Firts I apply a Feature Effect:

 

layerView.featureEffect = null;
let featureFilter = new FeatureFilter({
where: "Type = '" + document.getElementById("filterText").value + "'"
});
layerView.featureEffect = new FeatureEffect({
filter: featureFilter,
excludedEffect: "grayscale(100%) opacity(30%)",
excludedLabelsVisible: false
});

 

FeatureEffect.png

Then I clear the Feature Effect:

 

layerView.featureEffect = null;

 

I can only see labels on features filtered by the previous Feature Effect.

ClearFeatureEffect.png

Can I see labels on all features after clear a previous FeatureEffect?

0 Kudos
1 Solution

Accepted Solutions
AnneFitz
Esri Regular Contributor

Hi @LuisAntonioRodriguezGonzalez - this appears to be a bug in 4.22. We'll take a look and get this fixed in an upcoming release! Thanks for letting us know. 

View solution in original post

0 Kudos
5 Replies
AnneFitz
Esri Regular Contributor

Hi @LuisAntonioRodriguezGonzalez - this appears to be a bug in 4.22. We'll take a look and get this fixed in an upcoming release! Thanks for letting us know. 

0 Kudos
AnneFitz
Esri Regular Contributor

Hi @LuisAntonioRodriguezGonzalez - this has been fixed and will be available in the 4.23 release. Thanks!

0 Kudos
LuisSolaRuiz
Emerging Contributor

Hi! I am using typescript and this assignation is not possible 

 

featureLayerView.featureEffect = null

 

Error: Type 'null' is not assignable to type 'FeatureEffect'. 

I've also tried, but not working: 

 

 featureLayerView.featureEffect.destroy()

 

GasparCascallana
New Contributor

Hi!, I´m also using typescript and the bug persists.

Null asignation is not posible. I tried asign to an empty FeatureEffect class but dont works.

featureLayerView.featureEffect = null
featureLayerView.featureEffect.destroy()
featureLayerView.featureEffect = new FeatureEffect()

 

Thank you

 

 

0 Kudos
GasparCascallana
New Contributor

Hi!

It was my fault. The problem was in the "excludedLabelsVisible" property, it has to be true for enable labels of excluded entities.

 

this.pointsLayer.featureEffect = new FeatureEffect({
  filter: new FeatureFilter({
    objectIds: [
      hit.graphic.attributes[
        constants.arcgis.layers.backhauls.fields.objectid
      ]
    ]
  }),
  excludedEffect: 'opacity(90%)',
  includedEffect: 'bloom(0.6 0.1pt 0) contrast(130%)',
  excludedLabelsVisible: true
})

 

@LuisAntonioRodriguezGonzalez In your example, the value is set to false.

Thank you.

0 Kudos