2011-02-16 42 views
0

我不明白。我可以用BalloonItemizedOverlay成功繪製一個點,但是,當我繪製多個點時,背景會從街景切換爲純海藍色。標記正確繪製在疊加層上,我可以點擊標記並按照它的要求進行操作,但我不明白爲什麼我的街道視圖消失並被海洋藍色背景取代。其他人遇到這個?我究竟做錯了什麼?我注意到,當它到達animateTo()命令時,它切換到藍色。任何人都成功實現了BalloonItemizedOverlay(具有多個點)?

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

+0

我建議你看看這個:http://stackoverflow.com/editing-help瞭解如何格式化代碼:)你會爲我們節省很多時間。 – Cristian 2011-02-16 20:55:46

回答

2

要轉換應該是* 1E6,不1E5。你的觀點可能在某處。你能縮小看看嗎?

+0

我改變它爲1E6,但重新安排邏輯到下面使它工作:int intLat =(int)(Double.parseDouble(loc.Latitude)* 1E6); int intLong =(int)(Double.parseDouble(loc.Longitude)* 1E6); – sexitrainer 2011-02-17 16:26:40

相關問題