2011-07-15 116 views

回答

1

你需要通过扩展ItemizedOverlay创建自己的叠加。您可以覆盖onTap()方法,以便在点击项目时执行任何操作。

基本傻例如:

public class CustomOverlay extends ItemizedOverlay<OverlayItem> { 
    private Activity mContext; 


    public CustomOverlay(Activity activity, Drawable defaultIcon) { 
     super(defaultIcon); 
     mContext = activity; 
    } 

    @Override 
    protected boolean onTap(int index) { 
     new AlertDialog.Builder(mContext).setItems(... 
     /* Etc. - You can show the dialog here. */ 
    } 
}