<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>修改模型高度</title>
<link href="./css/widgets.css" rel="stylesheet">
<link href="./css/bootstrap.min.css" rel="stylesheet">
<link href="./css/pretty.css" rel="stylesheet">
<script src="./js/jquery.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/bootstrap-select.min.js"></script>
<script src="./js/require.min.js" data-main="js/main"></script>
<script src="./js/config.js"></script>
</head>
<body>
<div id="container" style="width: 100%; height: 100%;"></div>
<script>
function onload(Cesium) {
var viewer = new Cesium.Viewer('container');
var myurl = "http://localhost:8090/"
viewer.imageryLayers.addImageryProvider(new Cesium.TiandituImageryProvider({
token: URL_CONFIG.TOKEN_TIANDITU
}));
viewer.imageryLayers.addImageryProvider(new Cesium.TiandituImageryProvider({
mapStyle : Cesium.TiandituMapsStyle.CIA_C,
token: URL_CONFIG.TOKEN_TIANDITU
}));
var scene = viewer.scene;
var widget = viewer.cesiumWidget;
try {
var promise = scene.open(myurl + "iserver/services/3D-xxx/rest/realspace");
Cesium.when(promise,function(layers){
''' 修改模型高度 '''
for(var i=0; i < layers.length; i++){
var style3D = new Cesium.Style3D();
''' 可调节此数值,然后依次查看是否合适'''
style3D.bottomAltitude = -100;
layers[i].style3D = style3D;
layers[i].refresh();
};
scene.camera.setView({
destination:
new Cesium.Cartesian3.fromDegrees(x, y, z),
});
},
function(e){
if (widget._showRenderLoopErrors) {
var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?';
widget.showErrorPanel(title, undefined, e);
}
});
}
catch(e){
if (widget._showRenderLoopErrors) {
var title = '渲染时发生错误,已停止渲染。';
widget.showErrorPanel(title, undefined, e);
}
};
};
</script>
</body>
</html>
修改模型高度
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...