android - Show a toast on clicking an overlay -
i have used following code displaying overlay
p = new geopoint((int) (addresses.get(0).getlatitude() * 1e6), (int) (addresses.get(0).getlongitude() * 1e6)); controller = mapview.getcontroller(); controller.setzoom(12); mapoverlay mapoverlay = new mapoverlay(map.this, p); list<overlay> listofoverlays = mapview.getoverlays(); listofoverlays.add(mapoverlay); controller.animateto(p, new runnable() { public void run() { controller.setzoom(12); } }); mapview.invalidate();
and file overlay drawn following...
super.draw(canvas, mapview, shadow); point screenpts = new point(); mapview.getprojection().topixels(p, screenpts); bitmap bmp = bitmapfactory.decoderesource(context.getresources(), r.drawable.overlay); canvas.drawbitmap(bmp, screenpts.x, screenpts.y - 32, null);
could please tell me changes need done display toast when click on overlay??
override overlay's ontap
method (here) , call toast.
Comments
Post a Comment