tile layer altitude

I expect the tile layer to appear above the base map:

const layers = viewer.scene.imageryLayers
const wgs84 = Cesium.Ellipsoid.WGS84.radii
const ellipsoid = new Cesium.Ellipsoid(wgs84.x * 2, wgs84.y * 2, wgs84.z * 2)
const tilingScheme = new Cesium.WebMercatorTilingScheme({ ellipsoid })
const options = {
        url : `\{tileUrl\}\+{d}`,
        maximumLevel : 8,
        credit : ‘Weather’,
        proxy: new Cesium.DefaultProxy(‘http://localhost:8081/proxy/’),
        tilingScheme,
        ellipsoid
      }
const weather = layers.addImageryProvider(new Cesium.createTileMapServiceImageryProvider(options))

...but it just appears at same altitude as base map.

Sorry:

OS = macOS latest
Browser = Chrome latest
Cesium Version = ^1.32.1

Hi there,

Thanks for all of the specifics! Are you sure that your tileset is set to be above the ground? In my experience, tilesets often need a bit of tweaking to sit nicely relative to the base layer. You can manually adjust the position of your tileset like in this code example:

https://groups.google.com/d/msg/cesium-dev/CqYeu6L6bhU/P0WywsBhBQAJ

That should allow you to put your tileset where you need it.

Hope that helps!

  • Rachel

I think this is different. This is related to an ImageryLayer (TMS) which as far as I can tell is only on "Globe". I cannot find a way to add another Globe instance to the scene (I tried adding it as a primitive). Maybe I can add an ImageryLayer as a primitive to the scene with a different ellipsoid than the scene Globe?

I tried suggested code from https://groups.google.com/forum/#!msg/cesium-dev/CqYeu6L6bhU/P0WywsBhBQAJ:

<code>
const options = {
            url : this.tileUrl,
            maximumLevel : 8,
            credit : ‘Weather’,
            proxy: new Cesium.DefaultProxy(‘http://localhost:8081/proxy/’)
          }
          const tmsProvider = new Cesium.createTileMapServiceImageryProvider(options)
          log.debug(tmsProvider)
          self.activeLayers[product] = self.map.scene.imageryLayers.addImageryProvider(tmsProvider)
          const heightOffset = 10000.0
          self.activeLayers[product].readyPromise.then(function(tileset) {
            const boundingSphere = self.activeLayers[product].boundingSphere
            self.map.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0, -2.0, 0))
            self.map.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)
            // Position tileset
            const cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center)
            const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0)
            const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset)
            const translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3())
            self.activeLayers[product].modelMatrix = Cesium.Matrix4.fromTranslation(translation)
          })
</code>

...but tiles still appear on the ground:

I don’t believe we have support for imagery that is not on the ellipsoid surface.

-Hannah

Ah, my mistake – the code I posted was for a 3D tileset. Hannah is right. I don’t think we have support for moving imagery tilesets off the surface. Sorry about that!

  • Rachel