Tip: Don't post a giant blob of unformatted, unreadable code. Post the
least bit of code that will get the point across. No one is going to read
through all that, it makes your post hard to read, and increases the
chances of people ignoring your post because they never get to the bottom
where the real substance is.

Cool? Cool. Now then:

On Mon, Feb 20, 2012 at 1:40 AM, Benjamin DJAHANDIDEH <
[email protected]> wrote:

> But how could I handle click events on those drawn routes ?
>
> For information, I was thinking about something which would probably
> be inefficient, but I'll tell it, we never knows :)
>

Try it. See how fast it is. Profile it. Optimize it, if necessary.


> Since the route establishement is basicaly a succession of drawings
> beetween two geopoints (segments), we could prehaps handle route
> clicking this way :
>
>  - Using the `onTouchEvent` method of the map overlay, we can get the
> geopoint associated to a click.
>  - Then we try to establish if the clicked geopoint is part of a route
> segment.
>

You probably want to determine if the clicked geopoint is "close enough" to
a route segment, as it's unlikely the user will always perfectly tap on a
route segment or point on said segment.


> One last information : Several routes will be drawn on the map at the same
> instant, so the click must be associated to a unique route and not all of
> them.
>

Then stop processing the tap event after you find one valid route.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

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

Reply via email to