<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
canvas {
border: 1px solid red;
}
</style>
</head>
<body>
<canvas id="canvas" >你的浏览器不支持canvas</canvas>
</body>
<script>
window.onload = function () {
if(!canvas.getContext) return;
let cxt = canvas.getContext('2d');
let graphical = [];
graphical[0] = {house_id: null, points: []};
let index = 0;
let restorePoint = {};
let clickStart = {};
let clickEnd = {};
let img = new Image();
img.src = "../img/electronic-map.png";
img.onload = function () {
canvas.width = img.width;
canvas.height = img.height;
cxt.drawImage(img, 0, 0, img.width, img.height);
canvas绘制多边形
最新推荐文章于 2024-05-08 15:18:16 发布