Search code examples
androidandroid-mapviewitemizedoverlayandroid-maps

Anyone implemented the BalloonItemizedOverlay (with multiple points) successfully?


i don't get it. i can plot one point successfully with the BalloonItemizedOverlay, however, when i plot multiple points, the background switches from a street view to a solid ocean blue color. the markers are plotted correctly on the overlay and i can click on the markers and it does what it's told, but i just don't get why my street view disappears and gets replaced by a ocean blue background. anyone else run into this? What am i doing wrong? I noticed that when it gets to the animateTo() command, it switches to blue.

List<Overlay> mapOverlays = mapView.getOverlays();
Drawable drawable = getResources().getDrawable(R.drawable.marker);
LocatorItemizedOverlay itemizedOverlay = new LocatorItemizedOverlay(drawable, mapView);

for (SingleLocation mloc : Locations)
{
  String strLocationAddress = mloc.AddressLine1 + ", " + mloc.City + ", " + mloc.State + "  " + mloc.ZipCode;
  point = new GeoPoint((int) (Double.parseDouble(mloc.Longitude) * 1E5),(int) (Double.parseDouble(mloc.Latitude) * 1E5));

  overlayItem = new OverlayItem(point,mloc.LocName,strLocationAddress);
  itemizedOverlay.addOverlay(overlayItem);
} 


mapOverlays.add(itemizedOverlay);
mapView.getController().animateTo(point);
mapView.getController().setZoom(10);

blue background image


Solution

  • To convert it should be * 1E6, not 1E5. Your points are probably out in the ocean somewhere. Can you zoom out to see?