百度地图 返回自定义绘制的几何覆盖物的坐标 webGL版本
简单地一个绘制几何图形,然后返回几何图形的坐标,这里坐标我直接在绘制完成后,以弹窗形式弹出,主要的代码为辅助工具库中的DrawingManager的代码和 绘制完成后的回调函数overlaycomplete,具体代码如下:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hello, World</title>
<style type="text/css">
html{
height:100%}
body{
height:100%;margin:0px;padding:0px}
#container{
height:100%}
</style>
<!--引入百度地图api 此版本为webGL-->
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.0&type=webgl&ak=你申请的ak秘钥"></script>
<!--引入百度地图BMapGLLib绘制工具库 -->
<link href="//mapopen.cdn.bcebos.com/github/BMapGLLib/DrawingManager/src/DrawingManager.min.css" rel="stylesheet">
<script type="text/javascript" src="//mapopen.cdn.bcebos.com/github/BMapGLLib/DrawingManager/src/DrawingManager.min.js">