0
我通過在谷歌地圖android
上通過使用PIN圖像顯示地點This Url如何平滑地在Android地圖上安裝pin?
此URL會在放大或縮小地圖時全部刷新。
我使用這個代碼在AsyncTask
onPostExcution
填充在地圖上的通話網址銷doInbackground
的負荷AS-
if(!valueoftotal.equalsIgnoreCase("") && !valueoftotal.equalsIgnoreCase(null))
{
if(Integer.parseInt(valueoftotal) > 0 && Integer.parseInt(valueoftotal) <= 100)
{
OverlayItem oi;
if(myHandler.getParsedData()!=null)
{
arrayList = myHandler.getParsedData();
}
linearbottom2.setClickable(true);
mapOverlays.clear();
//OverlayItem overlayItem,overlayItem1;
overlay.removeAll();
lineartabbar.setBackgroundResource(R.drawable.mapbar);
if(arrayList.size()!=0 && arrayList.size()>1)
{
for(int i = 0; i < arrayList.size(); i++)
{
String latvalue = arrayList.get(i).getLatitude().toString();
String lonvalue = arrayList.get(i).getLongitude().toString();
GeoPoint point = null;
try
{
point = new GeoPoint((int)(Double.parseDouble(latvalue)*1E6),(int)(Double.parseDouble(lonvalue)*1E6));
}
catch (NumberFormatException e)
{
// TODO: handle exception
}
if(point != null)
{
if(arrayList.get(i).getUnitstotal().equalsIgnoreCase("1"))
{
oi = overlay.createItem(i);
System.out.println("overlayyyyyyyyyyyyy" + overlay + "\toiiiiiiiiii"+oi);
if(overlay!=null)
{
overlay.addItem(oi);
}
}
else if(!arrayList.get(i).getUnitstotal().equalsIgnoreCase("1"))
{
oi = overlay.createItem(i);
if(overlay!=null)
{
System.out.println("2overlayyyyyyyyyyyyy" + overlay + "\toiiiiiiiiii" + oi);
overlay.addItem(oi);
}
}
}
}
mapOverlays.add(overlay);
mapView.invalidate();
}
else if(arrayList.size()!=0 && arrayList.size()==1)
{
for(int i = 0; i < arrayList.size(); i++)
{
String latvalue = arrayList.get(i).getLatitude().toString();
String lonvalue = arrayList.get(i).getLongitude().toString();
GeoPoint point = null;
try
{
point = new GeoPoint((int)(Double.parseDouble(latvalue)*1E6),(int)(Double.parseDouble(lonvalue)*1E6));
}
catch (NumberFormatException e)
{
// TODO: handle exception
}
if(point != null)
{
if(arrayList.get(i).getUnitstotal().equalsIgnoreCase("1"))
{
oi = overlay.createItem(i);
System.out.println("listing when 1 value is "+arrayList.get(i).getUnitstotal());
overlay.addItem(oi);
mc.animateTo(point);
}
else if(!arrayList.get(i).getUnitstotal().equalsIgnoreCase("1"))
{
oi = overlay.createItem(i);
System.out.println("listing when more value is "+ arrayList.get(i).getUnitstotal());
overlay.addItem(oi);
mc.animateTo(point);
mc.setCenter(point);
mc.setZoom(18);
}
}
}
mapOverlays.add(overlay);
mapView.invalidate();
MapController mcontrller =mapView.getController();
但問題是,當我立即觸摸地圖,它刪除所有引腳,並開始裝載新位置。我想先平穩地加載所有位置,然後再移除。
請任何人都幫我ASAP
,對不起我的解釋。
它不是我的要求,對不起,如果問題不清楚... ... - – sandee