官方绘制案例:https://lbs.qq.com/webDemoCenter/glAPI/glEditor/toolDraw
官方编辑案例:https://lbs.qq.com/webApi/javascriptV2/jsGuide/jsCover
整合绘制和编辑代码如下:
记得把代码里的key改成自己的!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>编辑几何图形</title>
</head>
<script charset="utf-8"
src="https://map.qq.com/api/gljs?libraries=tools&v=1.exp&key=改成自己的key"></script>
<style type="text/css">
html,
body {
height: 100%;
margin: 0px;
padding: 0px;
}
#map-container {
width: 100%;
height: 80%;
position: relative;
}
#toolControl {
position: abs