4

Im Implementing layers on google maps in Android using GeoJson Utility Library. Layers only contains Polygons as Features. I can set feature listener as below

layer.setOnFeatureClickListener(new GeoJsonLayer.OnFeatureClickListener() {
                @Override
                public void onFeatureClick(Feature feature) {

                    Log.i("GeoJsonClick", "Feature clicked: " + feature.getProperty("AName"));

                }
            });

When user click on map,This listener consume click event but I also want to trigger OnMapClickListener to get Lat/Lng of clicked position but I know click event will not passed to lower index objects on map as mentioned in Docs

Note: If multiple overlays or shapes (markers, polylines, polygons, circles and/or ground overlays) are overlaid on top of each other, the click event is cycled through the cluster of markers first, then triggered for other clickable overlays or shapes based on their z-index values. At most one event is triggered per click. In other words, the click is not passed down to the overlays or shapes with lower z-index values. Read more about marker z-index and click events..

But I want to consume click event on both places i.e at layer (Polygon level) and Map Level. how I could achieve this? Thanks in Advance

Zaid Mirza
  • 3,540
  • 2
  • 24
  • 40

1 Answers1

0

I answered a similar question here: OnMarkerClick() Method not working Android Studio

I believe this should also answer your question

j3App
  • 1,510
  • 1
  • 17
  • 26