通过canvas加载geojson深入解析添加矢量数据本质
const [state, rs, err] = await getData('./sx.json')
let canvas = document.getElementById('canvas');
let ctx = canvas.getContext("2d");
let width = window.innerWidth;
let height = window.innerHeight;
canvas.width = width;
canvas.height = height;
let center = [108, 36]
let scale = 100
let zoom = 5
let zooms = {
5: 100,
6: 110,
7: 130,
8: 170,
9: 250,
10: 410,
11: 730,
12: 1470,
13: 2600,
14: 5000,
15: 10000,
16: 20000,
17: 40000
}
function coordTrans(coord, center) {
coord = [coord[0], -coord[1]<