{"action":"opened","issue":{"url":"https://api.github.com/repos/MKergall/osmbonuspack/issues/213","repository_url":"https://api.github.com/repos/MKergall/osmbonuspack","labels_url":"https://api.github.com/repos/MKergall/osmbonuspack/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/MKergall/osmbonuspack/issues/213/comments","events_url":"https://api.github.com/repos/MKergall/osmbonuspack/issues/213/events","html_url":"https://github.com/MKergall/osmbonuspack/issues/213","id":144310948,"number":213,"title":"If makers overlap, the clicked one is the one behind.","user":{"login":"2ndGAB","id":14370028,"avatar_url":"https://avatars.githubusercontent.com/u/14370028?v=3","gravatar_id":"","url":"https://api.github.com/users/2ndGAB","html_url":"https://github.com/2ndGAB","followers_url":"https://api.github.com/users/2ndGAB/followers","following_url":"https://api.github.com/users/2ndGAB/following{/other_user}","gists_url":"https://api.github.com/users/2ndGAB/gists{/gist_id}","starred_url":"https://api.github.com/users/2ndGAB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2ndGAB/subscriptions","organizations_url":"https://api.github.com/users/2ndGAB/orgs","repos_url":"https://api.github.com/users/2ndGAB/repos","events_url":"https://api.github.com/users/2ndGAB/events{/privacy}","received_events_url":"https://api.github.com/users/2ndGAB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-29T16:04:22Z","updated_at":"2016-03-29T16:04:22Z","closed_at":null,"body":"Hi,\r\nI'm a bit annoyed because I've implemented an extension to `RadiusMarkerClusterer()` because, from my point of view, few close markers (2 or 3), shouldn't be clustered.\r\n\r\nSo my implementation is this one:\r\n\r\n    package com.example.alain.overlappedmarkers;\r\n    \r\n    import android.content.Context;\r\n    import android.graphics.Rect;\r\n    \r\n    import org.osmdroid.bonuspack.clustering.RadiusMarkerClusterer;\r\n    import org.osmdroid.bonuspack.clustering.StaticCluster;\r\n    import org.osmdroid.bonuspack.overlays.Marker;\r\n    import org.osmdroid.util.BoundingBoxE6;\r\n    import org.osmdroid.util.GeoPoint;\r\n    import org.osmdroid.views.MapView;\r\n    \r\n    import java.util.ArrayList;\r\n    import java.util.Iterator;\r\n    \r\n    /**\r\n     * Created by Alain on 03/02/2016.\r\n     */\r\n    public class MyRadiusMarkerClusterer extends RadiusMarkerClusterer {\r\n    \r\n        public int getMinNumOfMarkersInCluster() {\r\n            return minNumOfMarkersInCluster;\r\n        }\r\n    \r\n        public void setMinNumOfMarkersInCluster(int minNumOfMarkersInCluster) {\r\n            this.minNumOfMarkersInCluster = minNumOfMarkersInCluster;\r\n        }\r\n    \r\n        int minNumOfMarkersInCluster = 1;   // Initialized to 1 to keep the default behavior\r\n    \r\n        public MyRadiusMarkerClusterer(Context ctx) {\r\n            super(ctx);\r\n        }\r\n    \r\n        @Override public ArrayList<StaticCluster> clusterer(MapView mapView) {\r\n    \r\n            ArrayList<StaticCluster> clusters = super.clusterer(mapView);\r\n    \r\n            ArrayList<StaticCluster> myClusters = new ArrayList<>();\r\n    \r\n            Iterator<StaticCluster> itClusters = clusters.iterator();\r\n    \r\n            while(itClusters.hasNext()) {\r\n                StaticCluster cluster = itClusters.next();\r\n    \r\n                if (cluster.getSize() < minNumOfMarkersInCluster) {\r\n                    for (int i = 0; i < cluster.getSize(); i++) {\r\n                        StaticCluster newCluster = new StaticCluster(cluster.getItem(i).getPosition());\r\n                        newCluster.add(cluster.getItem(i));\r\n                        myClusters.add(newCluster);\r\n                    }\r\n                } else {\r\n                    myClusters.add(cluster);\r\n                }\r\n            }\r\n            \r\n            return myClusters;\r\n        }\r\n    }\r\n\r\nBut I get a strange problem when 2 markers are overlapped because when I click on them the one which gets the click is not the topmost one but the one behind!?!\r\n\r\nCan you guess what could cause this problem please?\r\n\r\nTest application is [here](https://github.com/2ndGAB/OverlappedMarkers)"}}