<!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> <script src='/bmgl/js/primitiveWaterFace.js'></script> <style> body { margin: 0; padding: 0; } .bmgl-widget-credits{display:none} #container { position: absolute; top: 0; bottom: 0; width: 100%; } </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', { terrainId: 'bigemap.9af15d8e', requestRenderMode:false, mapId: 'bigemap.zhongkexingtu' }); //不启用地形遮挡 viewer.scene.globe.depthTestAgainstTerrain=false; function applyWaterMaterial(primitive) { primitive.appearance.material = new bmgl.Material({ fabric : { type : 'Water', uniforms : { specularMap:'/bmgl/images/earthspec1k.jpg', normalMap:'/bmgl/images/waterNormals.jpg', frequency: 10000.0, animationSpeed: 0.02, amplitude: 1.0 } } }); } var worldRectangle = viewer.scene.primitives.add(new bmgl.Primitive({ geometryInstances : new bmgl.GeometryInstance({ geometry : new bmgl.RectangleGeometry({ rectangle : bmgl.Rectangle.fromDegrees(-180, -90, 180.0, 90.0), vertexFormat : bmgl.EllipsoidSurfaceAppearance.VERTEX_FORMAT }) }), appearance : new bmgl.EllipsoidSurfaceAppearance({ aboveGround : true }), show : true })); applyWaterMaterial(worldRectangle); viewer.scene.camera.setView({ destination:new bmgl.Cartesian3(-2768111.144321513,5908699.668433571,2540308.274316914), orientation:{ "heading":6.283185307179575,"roll":0,"pitch":-1.5661443643886295 } }); </script> </body> </html>
源码