1

I am a beginner android programming.I want to create a balloon on the map. I read mapViewBalloon-example on this link https://github.com/jgilfelt/android-mapviewballoons but i don't know, is the BalloonItemizedOverlay a library?? Should i add it to the program or i should write BalloonItemizedOverlay class in the program? I read this class but i could not understand most of the code of this class :(

Thanks for help.

  • please provide the code you have tried. so we can help you. – Inbar Rose Nov 08 '12 at 15:18
  • add it as a library. dl the whole project, import it in eclipse, make it a library, add it as a library to your project, and voila – njzk2 Nov 08 '12 at 15:30
  • I download the program(mapviewballoons_master) but i don't see the library.Where to find it? Do i import this library to my program? Should i understand the codes of BalloonItemizedOverlay or this like another libraries of android like android.content.Context? – simon Quicke Nov 08 '12 at 16:21
  • Nobody is here? Please help me :( Thanks – simon Quicke Nov 08 '12 at 20:44
  • I still don't understand answer of my question. Please help me my friends :) – simon Quicke Nov 09 '12 at 09:49

1 Answers1

-2

add a class extends ItemizedOverlay (Not fully coded you should done everything.)

public class MyItemizedOverlay extends ItemizedOverlay<OverlayItem> {


//it gives abstract methods one of them is onTap (onTap will show dialog 
//when user tap overlay item).
  @Override
  protected boolean onTap(int index) {
      AlertDialog.Builder dialog = new AlertDialog.Builder(context);
    dialog.setTitle(item.getTitle());
    dialog.setMessage(item.getSnippet());
    dialog.setCancelable(true);
    dialog.setNegativeButton(dissmis, new OnClickListener() {

        public void onClick(DialogInterface dialog, int which) {
            // TODO Auto-generated method stub
            dialog.dismiss();
        }
    });
  }

}

you i add alertDialog to handle balloon. And add some buttons if you want to dissmiss etc options. Also you can add title and message to shown information(text).

Barış Çırıka
  • 1,570
  • 1
  • 15
  • 24