views:

59

answers:

1

friends,

right now i am showing list of map overlays on google map using following code

 mapOverlays = mapView.getOverlays();
        drawable = this.getResources().getDrawable(R.drawable.balloon);
        itemizedOverlay = new MarkerItemizedOverlay(drawable,this);

        GeoPoint point;
        OverlayItem overlayitem;
         for (DalMapSearch t : Sr)
         {
             if(t != null)
             {
            point = new GeoPoint((int) (t.getLati() * 1E6),  (int) (t.getLongi() * 1E6));
             overlayitem = new OverlayItem(point, heading, t.getAd_text()+", "+t.getLocation()+"@@"+t.getAd_id());
            itemizedOverlay.addOverlay(overlayitem);
             }

         }
         mapOverlays.add(itemizedOverlay);


        // marker code goes here

        mc.animateTo(myLocation);

        mc.setZoom(12); 
        mapView.invalidate();

so in such a scenario balloon is displayed i want to show other images too depened upon category or a if statement. any one guide me how can i show different images as a map overlay? for example images are imageA,ImageB,ImageC

any help would be appreciated.

A: 

GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());

    drawable = this.getResources().getDrawable(R.drawable.marker);
    itemizedOverlay = new MyItemizedOverlay(drawable);
    OverlayItem overlayItem = new OverlayItem(point, "", "");
    itemizedOverlay.addOverlay(overlayItem);
    mapOverlays.add(itemizedOverlay);


    GeoPoint point2 = new GeoPoint(lt2.intValue(),long2.intValue() );
    // All "B"s
    drawable = this.getResources().getDrawable(R.drawable.icon);
    itemizedOverlay = new MyItemizedOverlay(drawable);
    OverlayItem overlayItem1 = new OverlayItem(point2, "", "");
    itemizedOverlay.addOverlay(overlayItem1);
    mapOverlays.add(itemizedOverlay);
UMMA