Android Google Maps API v2 - how to change marker icon

后端 未结 8 1146
青春惊慌失措
青春惊慌失措 2021-01-31 16:34

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

8条回答
  •  无人及你
    2021-01-31 16:51

    It's very simple :

    new MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.icon))
    

    In case you want the icon from a bitmap

    new MarkerOptions().icon(BitmapDescriptorFactory.fromBitmap(bitmap));
    

提交回复
热议问题