I am trying to change marker icon. I get the image from one server directory.
When I put break point every time the \"bit\" result is null
. And when I run t
In the newer versions of GoogleMaps for Android you can't call .setIcon()
on a MarkerOptions
object. Instead you have to add the marker options to the map which will give you a Marker
on which you can then change the icon.
In Kotlin the code would look like this:
val markerOptions = MarkerOptions()
markerOptions.position(LatLng(40.419900, -111.880767))
val marker: Marker? = googleMap?.addMarker(markerOptions)
val bitmapDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_customer_symbol)
marker?.setIcon(bitmapDescriptor)