<!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; } .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', {mapId:'bigemap.zhongkexingtu',terrainId: 'bigemap.9af15d8e',}); viewer.entities.add({ id:'polygon', polygon:{ hierarchy:bmgl.Cartesian3.fromDegreesArray([ 100,30, 104,30, 104,34 ]), heightReference:bmgl.HeightReference.CLAMP_TO_GROUND, material:new bmgl.ImageMaterialProperty({ repeat:new bmgl.Cartesian2(1,1), image:'/bmgl/data/images/texture1.png', }), }, }); viewer.flyTo(viewer.entities); </script> </body> </html>
源码