【发布时间】:2010-08-20 12:17:40
【问题描述】:
我有以下代码,它在指定的 x/y 屏幕坐标处绘制一个标记。就这样……
public boolean draw(Canvas canvas, MapView mapView,
boolean shadow, long when)
{
super.draw(canvas, mapView, shadow);
//---translate the GeoPoint to screen pixels---
Point screenPts = new Point();
mapView.getProjection().toPixels(p, screenPts);
//---add the marker---
Bitmap bmp = BitmapFactory.decodeResource(
getResources(), R.drawable.marker);
canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);
System.out.println("X: " + screenPts.x + "Y: " + screenPts.y);
return true;
}
但是 API 中是否有任何基于 lat/lng 绘制点的已知方法?
【问题讨论】:
标签: java android google-maps