- Author:
-
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: