-2

i Followed this answer

and here is my code

Marker marker = mMap.addMarker(markerOptions);
    PicassoMarker picassoMarker = new PicassoMarker(marker);
    Picasso.with(getActivity()).load(url).into(picassoMarker);


    mMap.addMarker(markerOptions);
    mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));

and it works like a boss but issue is that its showing both the red pin and the loaded bitmap

enter image description here

Community
  • 1
  • 1
Adeel Turk
  • 897
  • 8
  • 23

2 Answers2

0

You can set custom marker icon like this

MarkerOptions markerOptions = new MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_location));

If you are getting marker image from server then you should first download image in background thread using AsyncTask and then you can set bitmap to marker

Akshay Panchal
  • 695
  • 5
  • 15
  • thanks for bothering . Brother for your information you can ask picasso library to dowload it for your rather than using asych , thats what i did and this made it much easier, check this http://stackoverflow.com/questions/27095469/how-can-i-use-picasso-to-add-icon-to-marker – Adeel Turk Mar 15 '17 at 07:37
0

You are adding the marker twice. The first time you use Picasso to change the icon but the second time you are adding it with the default icon using your MarkerOptions. Just remove this line:

mMap.addMarker(markerOptions);
antonio
  • 18,044
  • 4
  • 45
  • 61