I am displaying a custom marker on my Google Map. They are placed fine, but they have this funny shadow. How can I remove the shadow?
@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);
开发者_如何学Python // ---add the marker---
/*Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pushpin);
canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 67, null);*/
return true;
}
}
I'd try to pass false
for the shadow
parameter when invoking the overridden method.
That means it should look like super.draw(canvas, mapView, false)
.
Try this:
@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;
}
}
精彩评论