Android Google Maps API v2 - how to change marker icon

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

    Inside "onMapReady(GoogleMap googleMap)"

    MarkerOptions marker = new MarkerOptions();
    marker.icon(BitmapDescriptorFactory.fromResource(R.drawable._icon));
    
    0 讨论(0)
  • 2021-01-31 17:08
          mMap = googleMap;
     LatLng sydney = new LatLng(Lat,Lng);
           mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney").icon(BitmapDescriptorFactory.fromResource(R.drawable.icon)));
     mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney,12.0f));
    
    0 讨论(0)
提交回复
热议问题