如何去除地图上标记上的阴影?
我正在我的 Google 地图上显示自定义标记。它们放置得很好,但它们有一个有趣的阴影。如何去除阴影?
@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;
}
}
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);
// ---add the marker---
/*Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pushpin);
canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 67, null);*/
return true;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在调用重写的方法时,我会尝试为
shadow
参数传递false
。这意味着它应该看起来像
super.draw(canvas, mapView, false)
。I'd try to pass
false
for theshadow
parameter when invoking the overridden method.That means it should look like
super.draw(canvas, mapView, false)
.试试这个:
Try this: