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. I don't receive broadcasts

Hello!

I have started developing a tool, which should react on an outgoing call or 
sms and also to be started at boot time. The start at boot time does work 
properply, but I'm not able to receive the broadcasts for the outgoing calls.

Who can tell me, what is wrong with my code??

For this, I added two receivers in my manifest and implemented the broadcast-
receivers:
manifest.xml:
----------------------------------
<receiver 
        android:enabled="true" 
        android:name=".BootUpReceiver"  
        android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
        <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
        <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
</receiver>
<receiver 
        android:name=".TelephoneViewer"
        android:enabled="true"
        android:exported="true"
        android:permission="">
        <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <action android:name="android.provider.Telephony.SMS_RECEIVED" />
        <action android:name="android.intent.action.PHONE_STATE" />
        <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
        </intent-filter>
</receiver>
----------------------------------

TelephoneViewer.java:
----------------------------------
public class TelephoneViewer extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
        Log.d(this.getClass().getSimpleName(), "Telephoneviewer.onReceive()");
        Toast.makeText(context,"TelephoneViewer.onReceive()", 
Toast.LENGTH_SHORT).show();
}
----------------------------------

Thank you very much for your support!

Best regards,
Frank

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

2. How to use custom layout for Menu?

Hi,
I like to use a custom layout so when the user presses menu button
from their phone it displays it? How can I listen to this button
event?

Thanks!
Moto!
--~--~---------~--~----~------------~-------~--~----~

3. inter-activity animations

4. Memory leak - heap size (again)

5. PARC implicit authentication group looking for users!

6. Setting tab heights

7. How to view android marketplace