<!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="/offline_data/newjunbiao/shapefile.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", infoBox: false, }); //shp數(shù)據(jù)加載 shapefile.open("/offline_data/newjunbiao/sc1/sc1.shp").then(function (source) { var baseData = { type: "FeatureCollection", features: [], }; source.read().then(function (result) { baseData.features.push(result.value); var promise = bmgl.GeoJsonDataSource.load(baseData, { //設置貼地 clampToGround: true, fill: bmgl.Color.fromCssColorString("#fde191").withAlpha(.5), }); promise.then(function (dataSource) { viewer.dataSources.add(dataSource); }); viewer.flyTo(promise); }); }); </script> </body> </html>