Multiple Overlays Question
Hi,
I haven't been able to achieve 1 action for a user clicking an OverlayItem and 1 action for a user clicking an empty location on the map.
I can't seem to get
@Override
public boolean onTap(GeoPoint point, MapView mapView){ Toast.makeText(TaskMapView.this, "boo", Toast.LENGTH_SHORT).show(); return false;}
To fire when
@Override
protected boolean onTap(int index) { OverlayItem item = mOverlays.get(index);
if(item != null){
AlertDialog.Builder dialog = new AlertDialog.Builder(TaskMapView.this);
dialog.setTitle(item.getTitle());
dialog.setMessage(item.getSnippet());
dialog.show();
return true;
}
return false;}
is active.
I tried using 2 overlays, changing the true/false of the return values to various combinations but the best I could get is 1 Itemizedoverlay firing for the protected onTap and one Overlay (plain) firing for the map click.
|