Tim Bray wrote:
> I have a MapActivity, and an Overlay on its MapView on which I draw some
> graphics (picture
> at http://www.tbray.org/ongoing/When/200x/2009/01/01/FeedMapper).  I
> handle touch events on the map and display popups.  I am having all
> sorts of problems because MapActivity makes its own MapView so I can't
> get in and subclass its onTouchEvent methods.  So I'm having to
> intervene in the Activity's dispatchTouchEvent, which has incorect x/y
> co-ords for the MapView and creates all sorts of problems when I display
> a popup over the map and try to make sure its buttons get the touches as
> opposed the what might be on the map underneath them.
> 
> Is there any way to inject my own overridden MapView or otherwise get at
> the existing one's onTouchEvent()?  Without this, it's really hard to do
> interactive map-based graphic apps starting with MapActivity.  -T

Unfortunately, MapView/MapActivity are not open source. Otherwise, I'd
recommend looking at the source and perhaps cloning/subclassing
MapActivity to give you the hooks you need.

IMHO, these sorts of events should be handled by listeners rather than
callbacks requiring subclasses, but that's just me.

plusminus has created a workalike to MapView using Open Street Map over
at http://osmdroid.googlecode.com/ -- possibly you will have better luck
using it.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Published!

--~--~---------~--~----~------------~-------~--~----~
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