Differentiate two markers at same place in android

1.1k Views Asked by At

Here in the code am displaying markers but if many markers have same latitude and logitude then the icons generated must have different colors or it must be moved a little bit so that we must be able to find that its in that location. Is it possible to do?

private void drawMarker(LatLng point, TextView icTag) {
    Bitmap icBitmap = null;
    icGen.setStyle(IconGenerator.STYLE_ORANGE);
    icGen.setContentRotation(0);
    icGen.setContentPadding(10,10,10,10);
    tvImage.setTypeface(imageFont);
    icGen.setContentView(tvImage);
    icBitmap = icGen.makeIcon();

    MarkerOptions markerOptions = new MarkerOptions()
            .position(latlng)
            .snippet("" + snip).position(point)
            .icon(BitmapDescriptorFactory
                    .fromBitmap(icBitmap));
    marker = googleMap.addMarker(markerOptions);

}
1

There are 1 best solutions below

0
On

you can setup a bit of logic in your code so that older items are either bigger or with different colors or with different anchors. Of course you need to check the distance of points before doing that, and i would suggest to use clustering which works fine for this kind of tasks