我怎样才能去除阴影在我的地图标记? [英] How can I remove the shadow on the markers on my map?

查看:186
本文介绍了我怎样才能去除阴影在我的地图标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我上显示我的谷歌地图自定义的标记。它们被放置好,但他们有这个有趣的阴影。我怎样才能去除阴影?

  @覆盖
        公共布尔平局(帆布帆布,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)

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).

这篇关于我怎样才能去除阴影在我的地图标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆