Android Google Maps API v2 - how to change marker icon

后端 未结 8 1145
青春惊慌失措
青春惊慌失措 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:48

    Try this,

      BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.location);
                LatLng bangalore = new LatLng(12.9716, 77.5946);
    
     MarkerOptions markerOptions = new MarkerOptions().position(bangalore)
              .title("Current Location")
                .snippet("hello").icon(icon);
    
    
     mMap.addMarker(markerOptions);
    

提交回复
热议问题