<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>三维模型【单体化分层】</title>
<link href="../Cesium/Widgets/widgets.css" rel="stylesheet" />
<script src="../Cesium/Cesium.js"></script>
<script src="../Script/libs/jquery/jquery-2.1.0.min.js"></script>
<script src="../Script/layer.js"></script>
<style>
html, body, #cesiumContainer {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
.control {
position: absolute;
min-width: 166px;
background: rgba(48, 51, 54, 0.7);
top: 10px;
right: 10px;
color: white;
font-size: 14px;
padding: 20px;
}
.splice {
border: solid white 1px;
margin: 6px 0;
}
/*弹出框样式*/
.cesium-popup {
position: absolute;
left: 0;
top: 5px;
text-align: left;
}
.cesium-popup-background {
background: rgba(35,72,72,.6);
border-radius: 6px;
}
.cesium-popup-content-wrapper {
text-align: center;
max-height: 600px;
overflow-y: auto;
box-shadow: 0 3px 14px rgba(0,0,0,.4);
text-align: left;
border-radius: 3px;
}
.cesium-popup-color {
color: white;
}
.cesium-popup-content {
margin: 15px 10px 10px;
line-height: 1.4;
font-size: 13px;
max-width: 439px;
min-width: 50px;
}
.cesium-popup-tip-container {
margin: 0 auto;
width: 40px;
height: 13px;
position: relative;
overflow: hidden;
}
.cesium-popup-tip {
box-shadow: 0 3px 14px rgba(0,0,0,.4);
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.cesium-popup-close-button {
position: absolute;
top: 0;
right: 0;
padding: 4px 4px 0 0;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma,Verdana,sans-serif;
text-decoration: none;
font-weight: 700;
background: transparent;
z-index: 9999;
}
.cesium-popup-close-button:hover {
cursor: pointer;
color: #23527c;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
<!-- 控制栏 -->
<div class="control">
<div>
<label><input type="radio" name="type" value="ld" checked="checked"/>楼栋</label>
</div>
<div>
<label><input type="radio" name="type" value="lc"/>楼层</label>
</div>
<div class="splice"></div>
<div>
<p id="selectedInfo"></p>
</div>
</div>
<!-- 消息提示框气泡 -->
<div id="tooltip-view" class="cesium-popup" style="transform: translate3d(364.5px, 338px, 0px); display: none; pointer-events:none;">
<a class="cesium-popup-close-button cesium-popup-color" onclick="document.getElementById('tooltip-view').style.display='none';">×</a>
<div class="cesium-popup-background" style="padding: 1px 0;">
<div id="tooltip-content" class="cesium-popup-content cesium-popup-color"></div>
</div>
<div class="cesium-popup-tip-container"><div class="cesium-popup-tip cesium-popup-background"></div></div>
</div>
<script>
var viewer, scene;
var ldCollection = new Cesium.PrimitiveCollection();
var lcCollection = new Cesium.PrimitiveCollection();
var url = '../data/modelSingulation/zydrc.json';
$(function () {
/* 解决加载gltf2.0报错的问题 */
var fixGltf = function (gltf) {
if (!gltf.extensionsUsed || !gltf.extensionsRequired) {
return;
}
var v = gltf.extensionsUsed.indexOf('KHR_technique_webgl');
var t = gltf.extensionsRequired.indexOf('KHR_technique_webgl');
if (v !== -1) {
gltf.extensionsRequired.splice(t, 1, 'KHR_techniques_webgl');
gltf.extensionsUsed.splice(v, 1, 'KHR_techniques_webgl');
gltf.extensions = gltf.extensions || {};
gltf.extensions['KHR_techniques_webgl'] = {};
gltf.extensions['KHR_techniques_webgl'].programs = gltf.programs;
gltf.extensions['KHR_techniques_webgl'].shaders = gltf.shaders;
gltf.extensions['KHR_techniques_webgl'].techniques = gltf.techniques;
var techniques = gltf.extensions['KHR_techniques_webgl'].techniques;
gltf.materials.forEach(function (mat, index) {
gltf.materials[index].extensions['KHR_technique_webgl'].values = gltf.materials[index].values;
gltf.materials[index].extensions['KHR_techniques_webgl'] = gltf.materials[index].extensions['KHR_technique_webgl'];
var vtxfMaterialExtension = gltf.materials[index].extensions['KHR_techniques_webgl'];
for (var value in vtxfMaterialExtension.values) {
var us = techniques[vtxfMaterialExtension.technique].uniforms;
for (var key in us) {
if (us[key] === value) {
vtxfMaterialExtension.values[key] = vtxfMaterialExtension.values[value];
delete vtxfMaterialExtension.values[value];
break;
}
}
};
});
techniques.forEach(function (t) {
for (var attribute in t.attributes) {
var name = t.attributes[attribute];
t.attributes[attribute] = t.parameters[name];
};
for (var uniform in t.uniforms) {
var name = t.uniforms[uniform];
t.uniforms[uniform] = t.parameters[name];
};
});
}
}
Object.defineProperties(Cesium.Model.prototype, {
_cachedGltf: {
set: function (value) {
this._vtxf_cachedGltf = value;
if (this._vtxf_cachedGltf && this._vtxf_cachedGltf._gltf) {
fixGltf(this._vtxf_cachedGltf._gltf);
}
},
get: function () {
return this._vtxf_cachedGltf;
}
}
});
initMap();
});
function initMap() {
viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider: layer.createImageryProvider({
type: 'www_tdt',
layer: 'img'
}),
// scene3DOnly:true,
homeButton: false, // 是否显示home控件
vrButton: false,
fullscreenButton: true,
animation: true, // 是否显示动
没有合适的资源?快使用搜索试试~ 我知道了~
Cesium单体化源码
共324个文件
png:145个
js:54个
jpg:53个
5星 · 超过95%的资源 需积分: 48 60 下载量 3 浏览量
2020-11-27
12:22:28
上传
评论 2
收藏 6.92MB ZIP 举报
温馨提示
Cesium单体化源码,用于学习
资源详情
资源评论
资源推荐
收起资源包目录
Cesium单体化源码 (324个子文件)
web.config 1KB
widgets.css 22KB
lighter.css 5KB
InfoBoxDescription.css 3KB
Animation.css 2KB
CesiumInspector.css 2KB
BaseLayerPicker.css 2KB
Cesium3DTilesInspector.css 2KB
NavigationHelpButton.css 2KB
lighter.css 2KB
shared.css 2KB
SceneModePicker.css 2KB
InfoBox.css 2KB
Geocoder.css 2KB
Viewer.css 1KB
Timeline.css 1KB
ProjectionPicker.css 1KB
CesiumWidget.css 1006B
lighter.css 890B
lighterShared.css 886B
lighter.css 620B
lighter.css 397B
SelectionIndicator.css 338B
lighter.css 336B
lighter.css 269B
PerformanceWatchdog.css 256B
FullscreenButton.css 102B
VRButton.css 94B
info-loading.gif 723B
3dtiles_fenceng.html 20KB
waterNormals.jpg 287KB
StarBurst.jpg 191KB
tycho2t3_80_mz.jpg 179KB
tycho2t3_80_py.jpg 165KB
tycho2t3_80_pz.jpg 165KB
tycho2t3_80_my.jpg 164KB
tycho2t3_80_px.jpg 135KB
tycho2t3_80_mx.jpg 131KB
DirtMask.jpg 111KB
waterNormalsSmall.jpg 33KB
moonSmall.jpg 18KB
2.jpg 16KB
2.jpg 16KB
2.jpg 16KB
3.jpg 15KB
1.jpg 15KB
3.jpg 15KB
0.jpg 14KB
1.jpg 13KB
1.jpg 13KB
1.jpg 13KB
3.jpg 12KB
1.jpg 12KB
1.jpg 12KB
2.jpg 12KB
0.jpg 12KB
3.jpg 12KB
3.jpg 12KB
3.jpg 12KB
2.jpg 11KB
2.jpg 11KB
1.jpg 11KB
1.jpg 11KB
2.jpg 11KB
3.jpg 11KB
0.jpg 10KB
0.jpg 10KB
0.jpg 10KB
3.jpg 10KB
1.jpg 10KB
1.jpg 10KB
0.jpg 9KB
0.jpg 9KB
1.jpg 9KB
0.jpg 9KB
0.jpg 8KB
0.jpg 8KB
2.jpg 8KB
0.jpg 8KB
0.jpg 7KB
0.jpg 7KB
1.jpg 7KB
0.jpg 6KB
Cesium.js 2.85MB
draco_decoder.js 771KB
createPolygonGeometry.js 256KB
createCoplanarPolygonGeometry.js 251KB
createPolylineVolumeGeometry.js 250KB
createCoplanarPolygonOutlineGeometry.js 246KB
createPolygonOutlineGeometry.js 243KB
createRectangleGeometry.js 241KB
createCorridorGeometry.js 232KB
createCircleGeometry.js 228KB
createEllipseGeometry.js 226KB
createCorridorOutlineGeometry.js 224KB
createVerticesFromHeightmap.js 221KB
createGeometry.js 220KB
combineGeometry.js 220KB
createPolylineVolumeOutlineGeometry.js 218KB
createWallGeometry.js 216KB
共 324 条
- 1
- 2
- 3
- 4
giser_Jason
- 粉丝: 8
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1