Overlay's and Z coordinate

Any chance I can get my simple image overlays off the ground with a simple Z coordinate in the code below?

addAdditionalLayerOption(

‘Single Image Overlay’,

new Cesium.SingleTileImageryProvider({

url : ‘/overlay1.php?’,

extent : new Cesium.Extent(

Cesium.Math.toRadians(-115.0),

Cesium.Math.toRadians(38.0),

Cesium.Math.toRadians(-107),

Cesium.Math.toRadians(39.75))

}),

1.0);

}

Not sure where to put it…

Thank you!

  • Adam

Adam,

I don’t think image layers support this, but it’s a good feature that we’ll probably add at some point.

However, since you are just using a single image, you can achieve the same affect (minus terrain if you are using it) with the Polygon and Image material. For example, paste the following code into Sandcastle and run (F8) -

var extent = new Cesium.Polygon();

extent.configureExtent(new Cesium.Extent(

Cesium.Math.toRadians(-120.0),

Cesium.Math.toRadians(40.0),

Cesium.Math.toRadians(-60.0),

Cesium.Math.toRadians(60.0)));

extent.height = 1000000.0; // in meters

extent.material = new Cesium.Material({

context : widget.scene.getContext(),

fabric : {

type : ‘Image’,

uniforms : {

image : ‘…/images/Cesium_Logo_Color.jpg’

}

}

});

widget.scene.getPrimitives().add(extent);

Patrick