Search code examples
androidgoogle-mapsandroid-studioandroid-activitylocation

BUG the marker change the color when touch it


The marker when loading from fragment, loading a color, but when clicked, it changes color, and I have no color change when I click on the marker. Any suggestions to fix it? because it is only in the view that changes, internally if the state logic is fine; the marker should actually be green, but it turns orange.

bug in marker, must be green

change color when touch it


Solution

  • set marker in this way hope it help

          //place marker where user just clicked
            marker = googleMap.addMarker(new MarkerOptions()
                    .position(latLng)
                    .title("You are here!!!")
                    .draggable(true)
                    .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));                 
            googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 15));