我有自己的课程,将标记放在mapview上,如下所示......
public class MyMapActivity extends MapActivity
{
private MapItemizedOverlay itemizedOverlay;
@Override
public void onCreate(Bundle savedInstanceState)
{
for(a loop to put all 10 datas into overlay)
{
OverlayItem overlayitem=new OverlayItem(some params);
overlayitem.setMarker(some bitmap);
itemizedOverlay.addOverlay(overlayitem);
}
mapView.getOverlays().add(itemizedOverlay);
}
}
public class MapItemizedOverlay extends ItemizedOverlay<OverlayItem>
{
//some code
@Override
protected boolean onTap(int index)
{
//Here I know what marker been clicked...
//and I already did when marker been clicked, an info window
//can be shows up.
}
}
例如,我有10个数据集,在地图上显示为10个标记,在ListView上显示。 我想要做的是当我点击ListView的第3行时,第3个标记 会弹出一个信息窗口,就像我点击它一样......
我该怎么做?