ANDROID OverlayItem - 传递值

时间:2012-04-04 00:47:11

标签: android android-maps android-mapview

是否可以在OverLayItem中发送除marker,title和snippet之外的值。 因为我想在点击地图中的气球时处理许多按钮,所以我需要额外的值,如ID,状态等。

2 个答案:

答案 0 :(得分:0)

是的,你可以通过,当然,OverlayItem就像任何其他类一样,更改它的构造函数并为它传递你在类中需要的值。

答案 1 :(得分:0)

请尝试创建新类别的overlayitem

import com.google.android.maps.OverlayItem;

import com.google.android.maps.GeoPoint;

public class MyOverlayItem extends OverlayItem{

    public String newvalue;

        public MyOverlayItem (GeoPoint point,String arg1,String  arg2,String newvalue)
        {
            super(point, arg1, arg2);
            this.newvalue=newvalue;
        }
}