最佳答案
因此,我在 android 映射中使用下面的绘制方法中的代码来绘制这个三角形:
paint.setARGB(255, 153, 29, 29);
paint.setStyle(Paint.Style.FILL_AND_STROKE);
paint.setAntiAlias(true);
Path path = new Path();
path.moveTo(point1_returned.x, point1_returned.y);
path.lineTo(point2_returned.x, point2_returned.y);
path.moveTo(point2_returned.x, point2_returned.y);
path.lineTo(point3_returned.x, point3_returned.y);
path.moveTo(point3_returned.x, point3_returned.y);
path.lineTo(point1_returned.x, point1_returned.y);
path.close();
canvas.drawPath(path, paint);
返回的 pointX _ 是我从字段中得到的坐标,它们基本上是经度和纬度。 结果是一个漂亮的三角形,但内部是空的,因此我可以看到地图。有办法加满吗?