<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://lib.baomitu.com/ol3/3.21.0-beta.2/ol.css">
<script src="https://lib.baomitu.com/ol3/3.21.0-beta.2/ol.js"></script>
<title>Document</title>
<style>
body {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
}
</style>
</head>
<body>
<div id="map" style="position: absolute; top: 0; bottom: 0;left: 0;right: 0;"></div>
<button οnclick="change()" style="position: absolute;right: 0;">切换</button>
<button οnclick="drawPol()" style="position: absolute;right: 0; top:120px">绘制面</button>
<script>
const g1 = {
"type": "FeatureCollection",
"f