How to remove marker icon

1.3k views Asked by At

I've got a marker with info window. How can I remove that green finger from the map? Look at this:

enter image description here

My code:

Marker startMarker = new Marker(mapView);
startMarker.setPosition(gPt);       
startMarker.setIcon(null);//doesn't help
startMarker.setAnchor(Marker.ANCHOR_CENTER, 1.0f);
InfoWindow infoWindow = new MyInfoWindow(R.layout.bonuspack_bubble,
        mapView, company);
startMarker.setInfoWindow(infoWindow);
startMarker.setTitle(company.getName());
startMarker.showInfoWindow();           
mapView.getOverlays().add(startMarker);
2

There are 2 answers

2
sasikumar On

Try this code

mapView.getOverlays().remove(startMarker);
mapView.invalidate();
0
MKer On

Understanding you want to show the infowindow, but without any marker icon: replace the default "green finger" marker by a small transparent icon.

  • Small (1x1 px), so that your InfoWindow sticks to the gPt position.
  • Transparent so that the user see nothing.

    startMarker.setIcon(mySmallTransparentIcon);