<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body onload="pageLoaded();">
<script language="javascript">
function pageLoaded() {
var txt = "105.75,29.47 105.74,29.5 105.77,29.53 105.77,29.53 105.83,29.52";
var array = txt.split(" ");
//get canvas by id
var canvas = document.getElementById('tCanvas');
//get 2d environment
var context = canvas.getContext('2d');
//draw polygon
context.beginPath();
context.moveTo(105.81, 29.47);
for (var a = 0; a < array.length; a++) {
context.lineTo(array[a]);
//alert(array[a]);
};
context.closePath();
context.stroke();
}
</script>
<canvas width="400" height="400" id="tCanvas" style="border:black 1px solid;">
</canvas>
</body>
</html>