<!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%; } .bmgl-widget-credits { display: none } </style> <title>Google Map Streets</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' }); var entity1 = viewer.entities.add({ position: bmgl.Cartesian3.fromDegrees(103.11111, 40.11111), ellipse: { semiMinorAxis: 2500.0, semiMajorAxis: 4000.0, material: bmgl.Color.BLUE.withAlpha(0.5)//可设置不同的MaterialProperty } }); //棋盘状材质 var entity2 = viewer.entities.add({ position: bmgl.Cartesian3.fromDegrees(103.22222, 40.22222), ellipse: { semiMinorAxis: 2500.0, semiMajorAxis: 4000.0, material: new bmgl.CheckerboardMaterialProperty({ evenColor: bmgl.Color.WHITE, oddColor: bmgl.Color.BLACK, repeat: new bmgl.Cartesian2(4, 4) }) } }); //斑马线状材质 var entity3 = viewer.entities.add({ position: bmgl.Cartesian3.fromDegrees(103.11111, 40.22222), ellipse: { semiMinorAxis: 2500.0, semiMajorAxis: 4000.0, material: new bmgl.StripeMaterialProperty({ evenColor: bmgl.Color.WHITE, oddColor: bmgl.Color.BLACK, repeat: 32, offset: 20, orientation: bmgl.StripeOrientation.VERTICAL }), stRotation:30 } }); //网格状材质 var entity4 = viewer.entities.add({ position: bmgl.Cartesian3.fromDegrees(103.22222, 40.11111), ellipse: { semiMinorAxis: 2500.0, semiMajorAxis: 4000.0, material: new bmgl.GridMaterialProperty({ color: bmgl.Color.YELLOW, cellAlpha: 0.2, lineCount: new bmgl.Cartesian2(8, 8), lineThickness: new bmgl.Cartesian2(2.0, 2.0) }) } }); viewer.flyTo(entity1) </script> </body> </html>
源码