我尝试了answer by Sherif elKhatib到How to change the marker for the overlay on tap for android?,但有些事情我不明白。
protected boolean onTap(int index)
{
// Here, what is mOverlays? I mean it is the object of what?
OverlayItem item = mOverlays.get(index);
// Is the mContext, the object of Context?
Drawable marker = mContext.getResources().getDrawable(R.drawable.icon);
marker.setBounds(0,0,marker.getIntrinsicWidth(),marker.getIntrinsicHeight());
item.setMarker(marker);
return true;
}
什么是mOverlays
和mContext
?
答案 0 :(得分:1)
什么是mOverlays和mContext?
mOverlays
大概是List<OverlayItem>
,因为它以get()
回复OverlayItem
。
mContext
是Context
,可能是您的MapActivity
。