Add URL Image to the Marker in Google Map


In this blog, you know how to add URL image marker in Google Map.

It is a tough task to add URL Image to Marker. I use Picasso Library to parse image, for getting more about Picasso library see my other blog. Before knowing to add a marker in Map. You should check In your Manifest file having google map API.

How to add?

Display a map, using the Maps SDK for Android.

  1. Add an<fragment> element to your activity’s layout file,activity_maps.xml This element defines aSupportMapFragment to act as a container for the map and to provide access to the objectGoogleMap. The tutorial uses the Android support library version of the map fragment, to ensure backward compatibility with earlier versions of the Android framework.

2. In your activity’s methodonCreate(), set the layout file as the content view. Get a handle to the map fragment by calling.FragmentManager.findFragmentById() Then use getMapAsync() to register for the map callback:

3. Implement the OnMapReadyCallback interface and override the onMapReady() method, to set up the map when the GoogleMap object is available:

Now I am describing, how to URL image load with Marker. Create a CustomTarget class that implement Target Interface, and load the bitmap to Marker via BitmapDescriptorFactory. The main issue comes when we add multiple Markers and load maker image from URL  because of Picasso load image take some time rapidly we add a marker in a loop so some marker is not displayed. How you fix that issue, you create multiple Target object instance and add them to the List for each Marker.

For more About Picasso.

Picasso Library Use for Image Loading in Android



. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


  • Mr. Baks
    Where did “targets” came from?
    • ashwini gupta (Moderator)
      It is an ArrayList of import com.squareup.picasso.Target; In the blog I have added multiple markers in the map so use list.

      For a Single marker

      Picasso.with(this).load("Your Image URL").into(new Target() {
      public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom loadedFrom) {
      Marker marker = mGooglemap.addMarker(new MarkerOptions()
      .anchor(0.0f, 1.0f) // Anchors the marker on the bottom left

      public void onBitmapFailed(Drawable drawable) {
      public void onPrepareLoad(Drawable drawable) {

  • css.php

    Excellent work, fast, good quality and understood the brief perfectly! Quick responses developing the project and very good cooperation. I suggest to anyone.

    Stathis Plakidas

    Stathis Plakidas

    Talk to Sales


    Live Chat
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home