我如何创建平面图并在 html5 canvas 中添加一些标记?

How can i create a floor map and add some markers in html5 canvas?

我有一张楼层地图的图像,我想在上面添加一些 markers/pointers
我在 canvas 标签中添加了图像,但不知道如何创建指针。
提前致谢。

如果您只想在 canvas 的某个坐标处画一个圆,您可以执行以下操作:

// Draw a 10px circle at 100, 200
var x = 100;
var y = 200;
var radius = 10;

context.beginPath();
context.arc(x, y, radius, 0, 2 * Math.PI, false);
context.fillStyle = 'green';
context.fill();