cannot extract extents of rectangle after loading imagery layer according to url

1. A concise explanation of the problem you’re experiencing.

i have created a function addAdditionalLayerOption() where i am passing my layer name ,imagery provider .and i can see the layer in the form of rectangle after clicking on url on my html page.But now when i want to zoom i have to pass extents to the zoom funtion or flyTo().But i dont want pass it to .fromdegrees() hardcoded i want to extract the bbox values from imagery provider but cannot see them anyhere so that i can pass them.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

addmylayer(layerNames)

{

addAdditionalLayerOption(layerNames[i],

new Cesium.WebMapServiceImageryProvider({

url :arrayOfUrls[layerNames[i]],

layers : “ddyn_bterm”,

parameters : {

transparent : true,

format : ‘image/png’,

         },

}),true,true);

}

now ths call goes to:

function addAdditionalLayerOption(name, imageryProvider, alpha, show) {

var layer = imageryLayers.addImageryProvider(imageryProvider);

layer.alpha = Cesium.defaultValue(alpha, 1);

layer.show = Cesium.defaultValue(show, false);

layer.name = name;

}

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

4. The Cesium version you’re using, your operating system and browser.

You should be able to just have the camera fly directly to your imagery layer like in this example:

https://sandcastle.cesium.com/index.html?src=Washington%20DC%202017.html

Let me know if that works.

You should be able to just have the camera fly directly to your imagery layer like in this example:

https://sandcastle.cesium.com/index.html?src=Washington%20DC%202017.html

Let me know if that works.

1. A concise explanation of the problem you’re experiencing.

i did changes as per following code, but my layer is on globe but its showing globe after clicking onmy layers url and not zoomin my layer

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

addmylayer(layerNames)

{

addAdditionalLayerOption(layerNames[i],

new Cesium.WebMapServiceImageryProvider({

url :arrayOfUrls[layerNames[i]],

layers : “ddyn_bterm”,

parameters : {

transparent : true,

format : ‘image/png’,

         },

}),true,true);

}

now ths call goes to:

function addAdditionalLayerOption(name, imageryProvider, alpha, show) {

var layer = viewer.imageryLayers.addImageryProvider(imageryProvider);

layer.alpha = Cesium.defaultValue(alpha, 1);

layer.show = Cesium.defaultValue(show, false);

layer.name = name;

viewer.flyTo(layer );