Select to view content in your preferred language

Refresh ImageryLayer

465
2
Jump to solution
07-17-2023 07:37 AM
matteorizzi
New Contributor II

Hi to everyone!

I have an Imagery Layer and a vertical slider in which I change a parameter to query the layer. 
When I have the default renderer everything works fine (e.g. I can see the layer change on realtime on map), but when I change the renderer to a Flow Renderer, the vertical slider changing doesn't work. On the contrary, with the FlowRenderer enabled, I zoom in after I've changed the parameter in the vertical slider, it works. 

This is the function triggered by any change in the vertical slider (so changing parameter of the layer):

 

	changeLevelLayer(value: string | number) {
		for (const layer of this.layerSelected) {
			const whereSplit = layer.mosaicRule.where.split("StdPressure");
			layer.mosaicRule.where = whereSplit[0] + "StdPressure = " + value;
			layer.refresh();
		}
	}

 


As I said, it works fine if there is default renderer but it doesn't work with Flow Renderer. 

How can I handle it? Is there any Known limitation?

Thank you so much!

1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

I do see the behavior you describe. You can workaround this issue by cloning the layer's mosaicRule, make the changes to the cloned mosaicRule then assign the mosaicRule back to the layer's mosaicRule as shown below: 

const where = "StdTime = " + `date'${whereDate}'`;
let rule = layer.mosaicRule.clone();
rule.multidimensionalDefinition = [];
rule.where = where;
layer.mosaicRule = rule;

 

View solution in original post

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

I do see the behavior you describe. You can workaround this issue by cloning the layer's mosaicRule, make the changes to the cloned mosaicRule then assign the mosaicRule back to the layer's mosaicRule as shown below: 

const where = "StdTime = " + `date'${whereDate}'`;
let rule = layer.mosaicRule.clone();
rule.multidimensionalDefinition = [];
rule.where = where;
layer.mosaicRule = rule;

 

0 Kudos
matteorizzi
New Contributor II

Thank you so much! Great workaround 😉

0 Kudos