由网友(少年自毁梦)分享简介:我上显示我的谷歌地图自定义的标记。它们被放置好,但他们有这个有趣的阴影。我怎样才能去除阴影? @覆盖 公共布尔平局(帆布帆布,MapView类MapView类,布尔阴影,长时){ super.draw(画布,MapView类,阴影); // ---翻译的Ge...![ArcGIS实用制图技巧 如何制作 阴影 效果](https://p.xsw88.cn/allimgs/daicuo/20230907/5589.png)
我上显示我的谷歌地图自定义的标记。它们被放置好,但他们有这个有趣的阴影。我怎样才能去除阴影?
@覆盖 公共布尔平局(帆布帆布,MapView类MapView类,布尔阴影,长时){ super.draw(画布,MapView类,阴影); // ---翻译的GeoPoint到屏幕像素--- 点screenPts =新点(); 。MapView.getProjection()在toPixels(geoPnt,screenPts); // ---添加标记--- / * BMP位图= BitmapFactory.de codeResource(getResources(),R.drawable.pushpin); canvas.drawBitmap(BMP,screenPts.x,screenPts.y - 67,NULL); * / 返回true; } }
解决方案
我想尝试通过假
为阴影
参数调用重写的方法时。
这意味着它应该看起来像 super.draw(画布,MapView类,FALSE)
。
![ArcGIS实用制图技巧 如何制作 阴影 效果](https://p.xsw88.cn/allimgs/daicuo/20230907/5589.png)
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;
}
}
解决方案
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)
.
相关推荐
最新文章