我需要转换这个区域地图:
<area shape="poly" coords="61,134,61,129,63,124,61,120,64,116,62,112,66,108,67,111,70,109,72,107,73,101,72,97,69,95,72,92,73,96,72,106,76,108,76,110,78,113,82,113,83,120,93,127,102,123,107,129,104,130,92,130,81,125,77,122,75,122,68,129,67,130,67,130,73,124,67,130,67,130,73,124,74,119" href="javascript:;" alt="formentera" >
使用 jQuery 和画布转换为以下格式之一:
..
var canvasi = document.getElementById("canvasIbiza");
$.stx = canvasi.getContext("2d");
..
case"ibizaciudad":
$.stx.save();
$.stx.beginPath();
$.stx.moveTo(77.6, 58);
$.stx.bezierCurveTo(77, 57.9, 75.8, 57.7, 75.2, 57.3);
$.stx.bezierCurveTo(74.5, 56.9, 74.3, 56.1, 73.9, 55.5);
$.stx.lineTo(71.3, 56.3);
$.stx.bezierCurveTo(70.5, 56, 69.7, 55.5, 69, 55.2);
$.stx.bezierCurveTo(67.6, 54.6, 65, 53.7, 64.8, 53.7);
$.stx.bezierCurveTo(64.7, 53.7, 63.4, 53.9, 63.2, 53.9);
$.stx.bezierCurveTo(63.1, 53.9, 63, 53.8, 62.8, 53.8);
$.stx.bezierCurveTo(63.4, 54.4, 64.2, 54.8, 64.7, 55.6);
$.stx.bezierCurveTo(65, 56.2, 64.9, 57, 65, 57.8);
$.stx.bezierCurveTo(65.5, 58.1, 68.3, 59.5, 68.3, 59.9);
$.stx.bezierCurveTo(68.3, 60.2, 66.7, 61.8, 66.7, 61.9);
$.stx.bezierCurveTo(66.9, 62.1, 69.1, 63.8, 69.1, 64);
$.stx.bezierCurveTo(69.1, 64.1, 69.1, 64.2, 69.1, 64.2);
$.stx.lineTo(71.4, 63.4);
$.stx.lineTo(70.8, 61.4);
$.stx.lineTo(73.6, 62.1);
$.stx.lineTo(73.4, 58.6);
$.stx.lineTo(78.4, 61.2);
$.stx.lineTo(77.6, 58.4);
$.stx.lineTo(77.6, 58);
$.stx.closePath();
$.stx.fillStyle = a;
$.stx.fill();
$.stx.restore();
break;
对应区域的地图是:
<area shape="poly" coords="80,57,78,57,76,55,74,56,71,55,67,53,66,53,65,53,67,55,67,57,71,59,69,61,71,63,71,64,73,63,73,61,76,62,76,58,81,61,80,58,80,57,80,57" href="javascript:;" alt="ibizaciudad" >
以前的开发人员这样做了,我不知道它是如何工作的,
任何的想法?
坐标之间是否应该存在关系?实在看不出来关系