
osmdroid - issue #450
ItemizedIconOverlay uses onSingleTapUp for detecting taps, when it should be using OnSingleTapConfirmed
ItemizedIconOverlay uses onSingleTapUp for detecting taps which means a double-tap will trigger item selection. It should be using OnSingleTapConfirmed.
Comment #1
Posted on Jul 16, 2013 by Massive OxWorkaround for this is extend ItemizedIconOverlay and override this methods
@Override public boolean onSingleTapUp(MotionEvent event, MapView mapView) { return false; }
@Override public boolean onSingleTapConfirmed(MotionEvent e, MapView mapView) { return super.onSingleTapUp(e, mapView); }
but it would be nice have this in "vanilla" code :)
Comment #2
Posted on Jul 25, 2013 by Happy GiraffeUpdated by r1256. Use onSingleTapConfirmed instead of onSingleTapUp for detecting taps. This prevents double-tapping from triggering an item tap.
Please test and report back results.
Comment #3
Posted on Jul 25, 2013 by Helpful RhinoHi,
If we use the ItemizedIconOverlay: I see that with the latest change the ItemizedOverlay.hitTest is called 2 times. One time from ItemizedIconOverlay.onSingleTapConfirmed through ItemizedIconOverlay.activateSelectedItems And if it returns false, then another one time through super.onSingleTapConfirmed at ItemizedOverlay.onSingleTapConfirmed
What's the reason for that super call, can we avoid it? Don't we already perform the hit test at ItemizedIconOverlay?
Regards.
Comment #4
Posted on Jul 25, 2013 by Happy GiraffeItemizedIconOverlay is user-contributed code. There is no Google-API equivalent. Consequently there is no guidance as to how it "should" be implemented. I don't know why there is an activateSelectedItems() since that could be done in onTap(). I'm inclined to leave it the way it is where the ItemizedIconOverlay provides activateSelectedItems() functionality and the ItemizedIconOverlay provides the onTap() functionality and the user can choose which hook works best for their tapping needs.
I don't know how much attention will be given to the concrete subclasses of ItemizedOverlay that are provided in the osmdroid library moving forward. I think they should be considered examples and be put into the sample project. They probably have been far surpassed by the functionality provided by osmbonuspack. Maybe they should be deprecated?
Comment #5
Posted on Oct 25, 2013 by Happy GiraffeThe primary fix has been released in 4.0. Additional changes discussed won't be implemented at this time.
Status: Fixed
Labels:
Type-Defect
Priority-Medium