0

Hi I am basically creating some markers on the map and for each mark I create an information window.

  1. Is it possible to add an image for instance for each marker's information window on the map?
  2. If so how?

This is googles documentation about markers but I can't find anything about images or so. Any idea? Thanks in advance!

private static final LatLng MELBOURNE = new LatLng(-37.813, 144.962);
private Marker melbourne = mMap.addMarker(new MarkerOptions()
         .position(MELBOURNE)
         .title("Melbourne")
         .snippet("Population: 4,137,400")
         .icon(BitmapDescriptorFactory.fromResource(R.drawable.arrow)));
BillyBigPotatoes
  • 1,330
  • 11
  • 23
Nikolas
  • 51
  • 1
  • 2
  • 8
  • Looks like the same question was already answered: http://stackoverflow.com/a/14812104/1028256 If you need image in info window, look here: http://stackoverflow.com/a/20514671/1028256 – Mixaz Mar 03 '14 at 20:31

2 Answers2

0

You can specify custom layout for every Marker's info window.

Please refer to setInfoWindowAdapter() function

Pavel Dudka
  • 20,754
  • 7
  • 70
  • 83
0

The .icon refers to the Marker's icon, not the Info window. If I'm following you correctly you want icons to show after you have tapped on the markers?

In this case you can call

gMap.setOnMarkerClickListener(new OnMarkerClickListener() {

    @Override
    public boolean onMarkerClick(final Marker marker) {
     Add what you want to show up here.
    }
    });

At which point you can refer to different markers based on information about them, for example their location on the map or their marker style. I parsed a full list of information related to my markers and then called in a set of custom XML layouts to show up after with icons and the correct information.

RED_
  • 2,997
  • 4
  • 40
  • 59