ItemizedOverlay.onTap() imprecise?

by gnugu » Tue, 16 Feb 2010 07:50:55 GMT


Sponsored Links
 Hello,
I'm using Google maps. I put the markers on map and my inherited
ItemizedOverlay overrides onTap() method.

Markers are 32x32 images.

However, I can tap quite a bit away from the marker and still receive
the event.
This becomes a problem when markers are close to each other.

Anybody knows why this is?

Thanks.

--



ItemizedOverlay.onTap() imprecise?

by gnugu » Wed, 17 Feb 2010 02:45:26 GMT


 And here is my answer:
        @Override
        protected boolean hitTest(SearchResultOverlayItem item,
            android.graphics.drawable.Drawable marker,
            int hitX,
            int hitY) {

                if (hitX > -22 && hitX < 22
                                && hitY < 4 && hitY > -36) {
                        return true;
                }
                return false;
        }





--


Sponsored Links


Other Threads

1. readonly singleline TextView and text which doesn't fit there completely

This feature is part of the next SDK. Using an attribute called
"ellipsize" you will be able to automatically add an ellipsis "..." at
the beginning, end or in the middle of the text, as needed.






-- 
Romain Guy
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~

2. readonly singleline TextView and text which doesn't fit there completely

is it possible to find out which portion of text is visible, so i can
alter it if it doesn't fit completely?

or even better, is it possible to set textview somehow to such
behaviour, that in case when text doesn't fit there completely it will
show only beginning of text and append "..." to the end?
--~--~---------~--~----~------------~-------~--~----~

3. When to use Activity or View ?

4. Eclipse 19% BUG

5. Problems running the emulator (error: com.google.android.phone is not responding)

6. best way to setup 3 buttons

7. Make a button reset a program