1

我想在 Android 中使用 Overlay 在 Google Maps 上添加标记...我的代码如下

@Override
    public boolean draw(Canvas canvas, MapView mapView, boolean shadow,
            long when) {
          Point screenPts = new Point(); mapView.getProjection().toPixels(p1,
          screenPts);
          //---add the marker--- 
          Bitmap bmp = BitmapFactory.decodeResource(getResources()
          , R.drawable.googlepin); ``
          canvas.drawBitmap(bmp, screenPts.x,
          screenPts.y-50, null);
                  }
        return super.draw(canvas, mapView, shadow, when);
    }

在 getResources() 下给 RedLine ....给任何建议....提前谢谢..

4

0 回答 0