GeoCesiumTerrainProvider

new Cesium.GeoCesiumTerrainProvider(options)

自定义TerrainProvider,继承CesiumTerrainProvider,在原有的基础上新增对高斯投影坐标系下量化地形瓦片的支持。
Name Type Description
options Object 参数选项
Name Type Default Description
url Resource | String | Promise.<Resource> | Promise.<String> 地形服务地址
requestVertexNormals Boolean false optional 是否向服务器请求额外的光照信息,即顶点法线信息
requestWaterMask Boolean false optional 是否请求水面掩码信息
requestMetadata Boolean true optional 是否请求瓦片元信息
credit Credit | String optional 数据源凭证
tilingScheme TilingScheme optional 切片方案
Author:
  • liuhonglei
Examples:
// 官方地形
var terrainProvider = new Cesium.GeoCesiumTerrainProvider({
 url: Cesium.IonResource.fromAssetId(1),
 requestVertexNormals: true,
 requestWaterMask: true
});
viewer.terrainProvider = terrainProvider;
// 360度金字塔切片方案地形
var terrainProvider = new Cesium.GeoCesiumTerrainProvider({
 url: "http://" + Cfg.host + "/geomap-api/JsCesuimDemo/resource/data/terrain/",
 requestVertexNormals: true,
});
viewer.terrainProvider = terrainProvider;
// 高斯投影坐标量化地形(无带号)
var tilingScheme = new Cesium.GeoProjectedTilingScheme({
 viewer: viewer,
 extent: [499988.31453309144, 4540539.362186298, 584163.6431428336, 4652136.257245313]  //layer.json中读取
});
var terrainProvider = new Cesium.GeoCesiumTerrainProvider({
 url: "/geomap-api/JsCesuimDemo/resource/data/gaussMeshTerrain/",
 tilingScheme: tilingScheme
});
viewer.terrainProvider = terrainProvider;
// 高斯投影坐标量化地形(有带号)
var tilingScheme = new Cesium.GeoProjectedTilingScheme({
            viewer: viewer,
            globeScaleDenominators: Cesium.GeoProjectedTilingScheme.GLOBESCALEDENOMINATORSWITHZONENUMBER,
            origin: [-2.00375083427892E7, 2.00375083427892E7],  //globe服务默认值
            extent: [4.149998831453309E7, 4540539.362186294, 4.1584163643142834E7, 4652136.257245313]  //layer.json中读取
        });
        var terrainProvider = new Cesium.GeoCesiumTerrainProvider({
            tilingScheme: tilingScheme,
            url: '...'
        });
        viewer.terrainProvider = terrainProvider;
Demo: