<!DOCTYPE html> <html> <head> <meta charset='UTF-8' /> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> <link href='http://bigemap.com:9000/bigemap-gl.js/v1.1.0/Widgets/widgets.css' rel='stylesheet' /> <script src='http://bigemap.com:9000/bigemap-gl.js/v1.1.0/bigemap-gl.js'></script> <style> body { margin: 0; padding: 0; } #container { position: absolute; top: 0; bottom: 0; width: 100%; background: url('http://www.bigemap.com/map_source/source/yw/lightback.jpg') no-repeat;//css控制背景 background-size:cover; } .bmgl-widget-credits { display: none } </style> <title>part_test</title> </head> <body> <div id='container'></div> <script> bmgl.Config.HTTP_URL = 'http://bigemap.com:9000'; var viewer = new bmgl.Viewer('container', { mapId: 'bigemap.zhongkexingtu', orderIndependentTranslucency: false, contextOptions: { webgl: { alpha: true, } }, }); viewer.scene.skyBox.show = false;//隐藏天空盒子 viewer.scene.backgroundColor = new bmgl.Color(0.0, 0.0, 0.0, 0.0);//隐藏黑色背景 viewer.scene.globe.baseColor = new bmgl.Color(0, 0, 0, 0)//替换球体默认蓝色 viewer.scene.globe.enableLighting = false;//隐藏太阳 viewer.shadows = false; viewer.scene.sun.show = false;//或者viewer.scene.sun.destroy(); viewer.scene.moon.show = false;//隐藏月亮 viewer.scene.skyAtmosphere.show = false;//大气圈 viewer.scene.fog.enable = false;//雾 </script> </body> </html>
源码