问题
I want to display different markers on my map. One solution I could find is to define a new overlay for each marker. But then I could find that it can be done easier with
OverlayItme.set Marker(Drawable marker);
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);
回答1:
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);
}
}
来源:https://stackoverflow.com/questions/8971704/is-it-possible-to-use-overlayitem-setmarker-with-no-shadow