如何删除地图上标记上的阴影?

时间:2010-11-17 05:36:16

标签: java android google-maps overlay android-mapview

我正在Google地图上显示自定义标记。他们被安排得很好,但他们有这个有趣的阴影。如何删除阴影?alt text

@Override
        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(geoPnt, screenPts);

            // ---add the marker---
            /*Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pushpin);
            canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 67, null);*/
            return true;
        }
    }

2 个答案:

答案 0 :(得分:6)

在调用重写方法时,我会尝试为false参数传递shadow

这意味着它应该看起来像super.draw(canvas, mapView, false)

答案 1 :(得分:1)

试试这个:

@Override
    public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {
      if (!shadow) {
        super.draw(canvas, mapView, shadow);

        // ---translate the GeoPoint to screen pixels---
        Point screenPts = new Point();
        mapView.getProjection().toPixels(geoPnt, screenPts);

        // ---add the marker---
        Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pushpin);
        canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 67, null);
      }
      return true;
    }
}