| <!DOCTYPE html> | 
| <html> | 
|   | 
| <head> | 
|     <meta charset="UTF-8"> | 
|     <title>绘制图形</title> | 
|     <style> | 
|         .toolsbar-mappic { | 
|             overflow-x: hidden; | 
|             overflow-y: auto; | 
|             padding: 0; | 
|         } | 
|   | 
|         .toolsbar-mappic ul li { | 
|             display: inline-block; | 
|             width: 64px; | 
|             list-style-type: none; | 
|             margin: 5px; | 
|             text-align: center; | 
|             cursor: pointer; | 
|             font-size: 12px; | 
|             color: #fff; | 
|         } | 
|   | 
|         .mapImg { | 
|             border-radius: 10px; | 
|             height: 64px; | 
|             width: 64px; | 
|         } | 
|   | 
|         .mapImg:hover { | 
|             box-shadow: 0 0 8px #fff, 0 0 8px #fff; | 
|         } | 
|   | 
|         .labelInput { | 
|             width: 140px; | 
|             height: 40px; | 
|             line-height: 40px; | 
|             font-size: 16px; | 
|             text-indent: 8px; | 
|             outline: 0; | 
|             float: left; | 
|             border: none; | 
|             box-shadow: 0 2px 6px #3a3c42; | 
|             border-top-left-radius: 2px; | 
|             border-bottom-left-radius: 2px; | 
|             background-color: rgba(63, 72, 84, 0.7); | 
|             color: white; | 
|         } | 
|     </style> | 
|     <link href="../../libs/layui/css/layui.css" rel="stylesheet"> | 
|     <script type="text/javascript" src="../../libs/jquery/jquery-3.5.1.min.js"></script> | 
|     <script type="text/javascript" src="../../libs/layui/layui.js"></script> | 
|     <script> | 
|         layui.use(['element', 'layer', 'form'], function () { | 
|             var element = layui.element; | 
|             var form = layui.form; | 
|             //监听折叠 | 
|             element.on('collapse(test)', function (data) { | 
|   | 
|             }); | 
|         }); | 
|     </script> | 
| </head> | 
|   | 
| <body> | 
|     <div class="toolsbar-mappic"> | 
|         <ul id="basemaps" style="margin-left: 20px;margin-top: 10px;"> | 
|             <li class="hover" onclick="drawplot('point')"> | 
|                 <div> | 
|                     <img class="mapImg" src="../../assets/images/draw/点.png"> | 
|                 </div> | 
|                 <div>点</div> | 
|             </li> | 
|             <li class="hover" onclick="drawplot('polyline')"> | 
|                 <div> | 
|                     <img class="mapImg" src="../../assets/images/draw/线.png"> | 
|                 </div> | 
|                 <div>折线</div> | 
|             </li> | 
|             <li class="hover" onclick="drawplot('polygon')"> | 
|                 <div> | 
|                     <img class="mapImg" src="../../assets/images/draw/面.png"> | 
|                 </div> | 
|                 <div>面</div> | 
|             </li> | 
|             <li class="hover" onclick="drawplot('label')"> | 
|                 <div> | 
|                     <img class="mapImg" src="../../assets/images/draw/文字.png"> | 
|                 </div> | 
|                 <div>文字</div> | 
|             </li> | 
|             <!-- <li> | 
|                 <input id="text" class="labelInput" type="text" placeholder="输入文字" autocomplete="off" /> | 
|             </li> --> | 
|         </ul> | 
|     </div> | 
|     <!--是否显示地形--> | 
|     <!-- <div id="terrain" style="color: white; font-size: 12px;"> | 
|         <input style="margin-left: 20px; margin-top: 10px;" type="checkbox" name="like1[write]" lay-skin="primary" title="显示地形" | 
|             checked="true"> 显示地形 | 
|     </div> --> | 
|     <script> | 
|         function drawplot(type) { | 
|             switch (type) { | 
|                 case 'point': { | 
|                     parent.drawPoint(); | 
|                     break; | 
|                 } | 
|                 case 'label': { | 
|                     //let text = document.getElementById('text').value; | 
|                     // parent.drawLabel(text===""?'文字':text); | 
|                     parent.drawLabel('文字'); | 
|                     break; | 
|                 } | 
|                 case 'polyline': { | 
|                     parent.drawPolyline(); | 
|                     break; | 
|                 } | 
|                 case 'polygon': { | 
|                     parent.drawPolygon(); | 
|                     break; | 
|                 } | 
|             } | 
|         } | 
|     </script> | 
|   | 
|   | 
| </body> | 
|   | 
| </html> |