2

Hi!

How can I display a popup when clicking on a marker in google maps api android?

Here is the marker

LatLng sLatLng12 = new LatLng(xx.xxxx, xx.xxxxx);
       googleMap.addMarker(new MarkerOptions()
        .position(sLatLng12)
        .title(getString(R.string.title1map))
        .snippet(getString(R.string.snippet1map))
        .icon(BitmapDescriptorFactory.fromResource(R.drawable.ikon)));

I want to display a huge text which snippet doesn't allow me, so I want to display a popup displaying a html page or anything that can handle a huge text such as "release note" sections of other apps.

Thanks in advance!

K3v
  • 71
  • 7

1 Answers1

1

I think an infowindow can help you with this. An InfoWindow displays content (usually text or images) in a popup window above the map, at a given location. The info window has a content area and a tapered stem. The tip of the stem is attached to a specified location on the map.

var contentString = "Im a pop-up";
var infowindow = new google.maps.InfoWindow({
content: contentString
});

Checkout this working sample here. For additional reference, see this SO thread.

Community
  • 1
  • 1
KENdi
  • 7,576
  • 2
  • 16
  • 31
  • thanks for your answer but I'm on android (java) not javascript. I use the InfoWindow but the Infowindow doesn't display a huge text. – K3v Jul 09 '16 at 14:31