本文介绍了是否有可能没有影子使用OverlayItem.setMarker()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的地图上显示不同的标记。一个解决方案,我能找到的定义每个标记的新的覆盖。但后来我发现,这是可以做到的更容易

using a single overlay. It works fine, but the markers are drawn with shadow and I would like to display the marker icon with no shadow, my original picture has no shadow, and I want to draw it as it is. is it possible?This is how I'm doing now:

markerpic = this.getResources().getDrawable(R.drawable.icon_map);
    markerpic.setBounds(0, 0, markerpic.getIntrinsicWidth(), markerpic.getIntrinsicHeight());

   GeoPoint gp = new GeoPoint((int)(lat*1E6), (int)(lng*1E6));

    overlayitem = new OverlayItem(gp, "Title", "Message");
        overlayitem.setMarker(markerpic);
        myoverlay.adOverlay(overlayitem);
        mapOverlay.add(myoverlay);
解决方案

I have created a subclass which extends ItemizedOverlay and override this in my class for removing the shadow:

public void draw(Canvas canvas, MapView mapView, boolean shadow)
    {
        if(!shadow)
        {
            super.draw(canvas, mapView, false);
        }
    }

这篇关于是否有可能没有影子使用OverlayItem.setMarker()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 06:30