【发布时间】:2012-03-12 12:42:46
【问题描述】:
我已经为这个问题苦苦挣扎了几个小时:
我正在尝试让我的 itemizedoverlay 工作,但我不断收到此错误:
The method boundCenterBottom(Drawable) is undefined for the type
我的班级:
public MyDynamicItemizedOverlay(Drawable defaultMarker) {
super(boundCenterBottom(defaultMarker));
items = new ArrayList<OverlayItem>();
populate();
}
public void addNewItem(GeoPoint location, String markerText,
String snippet) {
items.add(new OverlayItem(snippet, markerText, location));
populate();
}
public void removeItem(int index) {
items.remove(index);
populate();
}
@Override
protected OverlayItem createItem(int index) {
return items.get(index);
}
@Override
public int size() {
return items.size();
}
@Override
public boolean onSnapToItem(int arg0, int arg1, Point arg2,
IMapView arg3) {
// TODO Auto-generated method stub
return false;
}
}
我正在使用 osmdroid-android-3.0.8 和 3.0.7(都试过了)。 ItemizedOverlay 实际上似乎没有这样的构造函数,但我能够谷歌搜索的所有样本都遵循相同的模式......
【问题讨论】:
-
解决方法:将带有 boundCenterBottom 的行替换为 // super(boundCenterBottom(defaultMarker));超级(defaultMarker,新 ResourceProxyImpl(getApplicationContext())); - 根本不使用缺少的方法..
标签: android android-mapview itemizedoverlay osmdroid