简体   繁体   中英

How can I set a Google Map Marker back to the default icon after changing it?

I am using the android-maps-utils library with a Google Map in an android app I'm working on, and I have several markers on the map. I change the icons for some markers when certain conditions are met using setIcon() with an IconGenerator .

I want to then change the icons back to the original red Google Maps standard icons when a different condition is met. I can track the condition and change them to a different custom icon, but don't know how to return them to the Google default short of finding an icon somewhere online and adding it into my project to add manually as I am with my personalized ones. Does anyone know how to retrieve the defaults?

你可以做

marker.setIcon(BitmapDescriptorFactory.defaultMarker());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM