I am some images on the SD card. I have also save their longitude and latitude ..Now i want to overlay all these images on the Google map as thumbnail image..and when i click on any thumbnail image it will move to the next activity as show the full picture.I can over lay only one image...and its code is this.....
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.googlemap);
mapView = (MapView) findViewById(R.id.mapView);
mapView.setBuiltInZoomControls(true);
// imm=(ImageView)findViewById(R.id.Google_Img_View);
mapView.setSatellite(true);
b=(Button)findViewById(R.id.googleImageDone);
b.setOnClickListener(this);
Intent i = getIntent();
//Parcelable myParcelableObject = (Parcelable) i.getParcelableExtra("name_of_extra");
bit = (Bitmap) getIntent().getParcelableExtra("Map");
//imm.setImageBitmap(bit);
String id = i.getStringExtra("lon");
String name = i.getStringExtra("long");
// mapView.setTraffic(true);
mc = mapView.getController();
String coordinates[] = {id,name};
double lat = Double.parseDouble(coordinates[0]);
double lng = Double.parseDouble(coordinates[1]);
pp = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));
mc.animateTo(pp);
mc.setZoom(19);
MapOverlay mapOverlay = new MapOverlay();
List<Overlay> listOfOverlays = mapView.getOverlays();
listOfOverlays.clear();
listOfOverlays.add(mapOverlay);
}
private class MapOverlay extends Overlay
{
@Override
public boolean draw(Canvas canvas, MapView mapView,
boolean shadow, long when)
{
super.draw(canvas, mapView, shadow);
Point screenPts = new Point();
//---translate the GeoPoint to screen pixels---
mapView.getProjection().toPixels(pp, screenPts);
//---convert the gif image into bmp
// Bitmap bmp = BitmapFactory.decodeResource(
// getResources(), R.drawable.e);
//---add the marker---
canvas.drawBitmap(bit, screenPts.x, screenPts.y-50, null);
return true;
}
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView)
{
if (event.getAction() == 1)
{
GeoPoint p = mapView.getProjection().fromPixels(
(int) event.getX(), (int) event.getY());
st1=p.getLatitudeE6() / 1E6+"";
st2=p.getLongitudeE6() /1E6+"";
Toast.makeText(getBaseContext(), "Location: "+
p.getLatitudeE6() / 1E6 + "," + p.getLongitudeE6() /1E6 ,
Toast.LENGTH_SHORT).show();
}
return false;
}
}