Question

Is it possible to make the MyLocationOverlay marker clickable? I have to launch a spinner when the overlay marker is clicked.

myLocationOverlay.setTouchEventListener(new OverlayTouchEventListener() {

        @Override
        public void onTouch(MotionEvent arg0, MapView arg1) {
            showLocationOverlayDialog();
            Log.i("MainMapActivity", "Main.getView() — location touched");
        }
    });

This is what I have so far. I haven't started with the spinner yet. But with this code, I think it's not working. It does not enter the setTouchEventListener. Could anybody please help me?

Was it helpful?

Solution

Create subclass of MyLocationOverlay and override dispatchTap(). Than just create myLocationOverlay as instance of this class

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top