使用产品:SuperMap_iClient3D_10i(2021)_for_WebGL_25863
操作系统:win10 x64
问题描述:
在使用官方的三维切片缓存(S3M)中的案例[鸟巢水面特效](http://support.supermap.com.cn:8090/webgl/examples/forJavaScript/examples/webgl/editor.html#S3MTiles_niaochao_water)进行二次开发,出现没法像官网例子那样渲染出图像,而是呈现一片绿色
问题重现步骤:
项目技术栈:Vue及其全家桶
1.引入需要的依赖
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<link href="/static/SuperMap_iClient3D_10i(2021)_for_WebGL_25863/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
<script src="/static/SuperMap_iClient3D_10i(2021)_for_WebGL_25863/examples/js/jquery.min.js"></script>
<script src="/static/SuperMap_iClient3D_10i(2021)_for_WebGL_25863/examples/js/config.js"></script>
<script src="/static/SuperMap_iClient3D_10i(2021)_for_WebGL_25863/Build/Cesium/Cesium.js"></script>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
2.三维图实现
<template>
<div>
<div id="cesiumContainer"></div>
</div>
</template>
<script>
export default {
mounted() {
this.initMap();
},
methods: {
initMap() {
let that = this;
// 初始化三维球
let viewer = new Cesium.Viewer("cesiumContainer");
var scene = viewer.scene;
scene.globe.depthTestAgainstTerrain = false;
var camera = scene.camera;
var promise = scene.open(URL_CONFIG.SCENE_NIAOCHAO);
},
},
};
</script>
<style lang="less" scoped>
</style>
3.呈现页面