Anyone implemented the BalloonItemizedOverlay (with multiple points) successfully?

不问归期 提交于 2019-12-14 03:08:34

问题


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);


回答1:


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



来源:https://stackoverflow.com/questions/5021898/anyone-implemented-the-balloonitemizedoverlay-with-multiple-points-successfull

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!