Hey everyone, I am currently working on an app and I want to lay a Bitmap over the Google Maps bitmap with the click of a button. I am assuming this is possible, and maybe a lot easier than I'm making it. Any help is welcomed. Thank you.
class MapOverlay extends com.google.android.maps.Overlay
{
@Override
public boolean draw(Canvas canvas, MapView mapView,
boolean shadow, long when)
{
super.draw(canvas, mapView, shadow);
mapView.setSatellite(true);
//---translate the GeoPoint to screen pixels---
Point screenPts = new Point();
mapView.getProjection().toPixels(p, screenPts);
//int x = (int)(Math.random()*100);
//---add the marker---
Bitmap bmp = BitmapFactory.decodeResource(
getResources(), R.drawable.straight);
canvas.drawBitmap(bmp, screenPts.x, screenPts.y-20, null);
return true;
}
}
and the class I wanna call it in is ...
private boolean MenuChoice(MenuItem item)
{
switch (item.getItemId()) {
case 0:
Toast.makeText(this, "First Choice.",
Toast.LENGTH_LONG).show();
//with this choice selected, display a bitmap over the map
return true;
}
return false;
}
class MapOverlay extends com.google.android.maps.Overlay
{
@Override
public boolean draw(Canvas canvas, MapView mapView,
boolean shadow, long when)
{
super.draw(canvas, mapView, shadow);
mapView.setSatellite(true);
//---translate the GeoPoint to screen pixels---
Point screenPts = new Point();
mapView.getProjection().toPixels(p, screenPts);
//int x = (int)(Math.random()*100);
//---add the marker---
Bitmap bmp = BitmapFactory.decodeResource(
getResources(), R.drawable.straight);
canvas.drawBitmap(bmp, screenPts.x, screenPts.y-20, null);
return true;
}
}
and the class I wanna call it in is ...
private boolean MenuChoice(MenuItem item)
{
switch (item.getItemId()) {
case 0:
Toast.makeText(this, "First Choice.",
Toast.LENGTH_LONG).show();
//with this choice selected, display a bitmap over the map
return true;
}
return false;
}