GeoTerrainProvider

new Cesium.GeoTerrainProvider(options)

吉奥地形
Name Type Description
options Object optional 参数选项:
Name Type Default Description
proxy DefaultProxy null optional 代理地址
dataType String GeoTerrainProvider.INT optional 地形数据是浮点型还是整型,GeoTerrainProvider.INT 或 GeoTerrainProvider.FLOAT
url Array optional 单一地形服务地址
urls Array optional 多个地形服务地址,如果有多个镜像地址可以使用此参数设置
tileType String GeoTerrainProvider.HEIGHTMAP optional 瓦片类型为heightmap还是quantized-mesh,默认为GeoTerrainProvider.HEIGHTMAP, 或设置为GeoTerrainProvider.QUANTIZED_MESH
maxExtent Number Cesium.Rectangle.fromDegrees(-180, -90, 180, 90.0) optional 瓦片服务的最大限制范围,默认值为世界范围(-180, -90, 180, 90.0)
topLevel Number 5 optional 瓦片服务的金字塔的最小层级
bottomLevel Number 25 optional 瓦片服务的金字塔的最大层级
tilingScheme TilingScheme new GeographicTilingScheme() optional 切片方案,默认是360度金字塔切片方案
Author:
  • liuck
Examples:
//示例1,加载天地图地形服务:		
		var terrainUrls = [
			"http://t0.tianditu.com/DataServer?T=elv_c&tk=e90d56e5a09d1767899ad45846b0cefd",
			"http://t1.tianditu.com/DataServer?T=elv_c&tk=e90d56e5a09d1767899ad45846b0cefd",
			"http://t2.tianditu.com/DataServer?T=elv_c&tk=e90d56e5a09d1767899ad45846b0cefd",
			"http://t3.tianditu.com/DataServer?T=elv_c&tk=e90d56e5a09d1767899ad45846b0cefd",
			"http://t4.tianditu.com/DataServer?T=elv_c&tk=e90d56e5a09d1767899ad45846b0cefd",
			"http://t5.tianditu.com/DataServer?T=elv_c&tk=e90d56e5a09d1767899ad45846b0cefd"
		];
		var t_Provider = new Cesium.GeoTerrainProvider({			
			maxExent: Cesium.Rectangle.fromDegrees(-180, -90, 180, 90.0),
			topLevel: 7,
			bottomLevel: 12,
			tileType: Cesium.GeoTerrainProvider.HEIGHTMAP,
			dataType: Cesium.GeoTerrainProvider.INT,
			urls: terrainUrls
		});
		viewer.terrainProvider = t_Provider;
		
		
		//示例2,加载内网量化地形服务:
		var t_Provider = new Cesium.GeoTerrainProvider({
			proxy: new Cesium.DefaultProxy(Cfg.proxyHostUrl),
			dataType: Cesium.GeoTerrainProvider.INT,
			tileType: Cesium.GeoTerrainProvider.QUANTIZED_MESH,
			url: "http://192.168.31.166:9010/MAP0517/DataServer"
		});
		viewer.terrainProvider = t_Provider;
// 加载地方坐标系地形服务(无带号)
var tilingScheme = new Cesium.GeoProjectedTilingScheme({
           viewer: viewer,
           extent: [499988.31453309144, 4540539.362186298, 584163.6431428336, 4652136.257245313],
       });
	   var terrainProvider = new Cesium.GeoTerrainProvider({
		   dataType: Cesium.GeoTerrainProvider.INT,
		   urls: ["http://192.168.100.231:8889/sy_dem_without_daihao/DataServer?"],
		   tilingScheme: tilingScheme
	   });
	   viewer.terrainProvider = terrainProvider;
// 加载地方坐标系服务(有带号)
 var tilingScheme = new Cesium.GeoProjectedTilingScheme({
            viewer: viewer,
	  	    globeScaleDenominators: Cesium.GeoProjectedTilingScheme.GLOBESCALEDENOMINATORSWITHZONENUMBER,
			origin: [-2.00375083427892E7, 2.00375083427892E7],
            extent: [4.149998831453309E7, 4540539.362186294, 4.1584163643142834E7, 4652136.257245313],
        });
		var terrainProvider = new Cesium.GeoTerrainProvider({
		   dataType: Cesium.GeoTerrainProvider.INT,
		   urls: ["http://192.168.100.231:8889/sy_dem_with_daihao/DataServer?"],
		   tilingScheme: tilingScheme
	   });
	   viewer.terrainProvider = terrainProvider;
Demo: