Tuesday, September 13, 2011

[android-developers] showing the default A icon on google maps

Hi,

I would like to know how can i place the default (A) baloon icon that
Google Maps has at the point i asked it to open. I don't need custom
icons, neither a custom text, just an icon or something showing the
center of the screen. My code is this one. I saw some things about
ItemizedOverlay but its proving to be just too complex.

public class MapViewer extends MapActivity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// setup the viewe
MapView mapview = new MapView(this,"...");
mapview.setBuiltInZoomControls(true);
mapview.setClickable(true);
mapview.setStreetView(true);
setContentView(mapview);
if (Loader.isFullScreen)

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// get passed parameters
Bundle extras = getIntent().getExtras();
double lat = extras.getDouble("lat");
double lon = extras.getDouble("lon");
mapview.setSatellite(extras.getBoolean("sat"));
int ilat = (int)(lat * 1e6);
int ilon = (int)(lon * 1e6);
// move the map to the given point
MapController mc = mapview.getController();
if (ilat != 0 || ilon != 0)
mc.setCenter(new GeoPoint(ilat,ilon));
mc.setZoom(21);
}

protected boolean isRouteDisplayed()
{
return false;
}
}


thanks

guich

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment