because my MapView is embedded in a much more complex view that's inside a scroller. rather than fight the ScrollView by allowing clicks in the embedded map, i just trap clicks on it and open up the Maps application.


Glad it worked out. Curious.. the overlayitem stuff seems to work pretty well.. why would you need to be able to control clicks directly on the map at any point, instead of providing overlayitems? On Thu, Jan 14, 2010 at 3:28 PM, Jason Proctor <<mailto:jason.android.li...@gmail.com>jason.android.li...@gmail.com> wrote:

Kevin Duffey wrote:

 Using Mark Murphy's online books, he describes how to do this. I don't
 know if it is the only way, but basically you extend
 ItemizedOverlay<OverlayItem>, in the constructor you do the
 items.add(OverlyaItem) method call. This will add overlayitem's to the
 map. These items are clickable and you can implement the click handler
 in the OverlayItem extending class that you provide/add.


That'll work for tapping on an OverlayItem. It will not work for tapping
on arbitrary spots on the map, though. I haven't tried doing that.


yeah, as i might have said ;-) i tried overlayitem.onTap() etc and got nowhere. supposedly as you say it will trap a click on the item in the overlay, but it didn't work for me.

however, i made a mistake in my code, and found that subclassing MapView and overriding onTouchEvent() actually works. it's quite a heavy-handed way of doing it, as i don't have much facility for selectively filtering events.

eh, ok i could mock up my own retroactive ACTION_DOWN in the situation where the drag goes outside my slop allowance, but that seems very messy...

thanks all
--
jason.vp.engineering.particle

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to <mailto:android-developers@googlegroups.com>android-developers@googlegroups.com
To unsubscribe from this group, send email to
<mailto:android-developers%2bunsubscr...@googlegroups.com>android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
<http://groups.google.com/group/android-developers?hl=en>http://groups.google.com/group/android-developers?hl=en



--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


--
jason.vp.engineering.particle
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to