nilkash
nilkash

Reputation: 7536

Detecting click event on overlay item in android map (V2)

Hi I am developing small android application in which I am using android map V2. I include ground overlay item in my map. So I want to detect click on overlay item. I added overlay item in following manner.

 LatLng NEWARK = new LatLng(0, 0);

        GroundOverlayOptions newarkMap = new GroundOverlayOptions()
                //.image(BitmapDescriptorFactory.fromResource(R.drawable.img)
                  .image(BitmapDescriptorFactory.fromBitmap(createDrawableFromView(this, markerView)))
                .position(NEWARK, 860000f, 650000f);
        GroundOverlay imageOverlay = googleMap.addGroundOverlay(newarkMap);

So I want to do something when user clicks on this overlay item. Need Some help. Thank you.

Upvotes: 0

Views: 1593

Answers (2)

Farhad
Farhad

Reputation: 189

You can listen it via googleMap.setOnGroundOverlayClickListener()

Upvotes: 1

MaciejGórski
MaciejGórski

Reputation: 22232

There are no OnClickListeners other than for Markers.

You may want to work with OnMapClickListener, where you get LatLng and do the check for distance yourself.

Upvotes: 0

Related Questions