android - How remove a single marker by Id? -
android - How remove a single marker by Id? -
this code remove click infowindow
// setting click event handler infowindow googlemap.setoninfowindowclicklistener(new oninfowindowclicklistener() { @override public void oninfowindowclick(marker marker) { // remove marker marker.remove(); } });
but, how remove single marker id without click infowindow ? remove button view
whenever add together marker map don't forget maintain record, adding map or arraylist.
your_google_map_obj.addmarker(new markeroptions()) //this adds marker on google map, should know returns marker object can utilize later removal
so marker marker=your_google_map_obj.addmarker(new markeroptions()) add together marker object list or map markerarraylist.add(marker); can extract marker list marker marker=markerarraylist.get(index); , phone call marker.remove();
other way it
after adding marker possible obtain reference:
marker marker = map.addmarker(..);
marker class has remove method, check this documentation
android google-maps google-maps-markers
Comments
Post a Comment