我通过从 api 的值动态使用 for 循环在 mapview 中显示多个点,并且我得到了精确点,但是我无法显示从用于获取标题的 api 获得的多个标题,但我正在显示最后一个在每一个精确点上一次又一次。这是我的代码。请帮忙。
for(int i = 0;i<adapt_objgps.latitude_array.length;i++){
System.out.println("valud oer values:::" +adapt_objgps.latitude_array[1]);
lat = adapt_objgps.latitude_array[i];
longit = adapt_objgps.longitude_array[i];
title = adapt_objgps.title_array[i];
address = adapt_objgps.address_array[i];
total = lat+","+longit;
System.out.println("value of total:::" +total);
System.out.println("value of title:::"+title);
mapview = (MapView) findViewById(R.id.mapView);
mapview.setBuiltInZoomControls(true);
List<Overlay> mapOverlays = mapview.getOverlays();
Drawable drawable = myrefgps.getResources().getDrawable(R.drawable.mark_red);
HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable);
double dLat = Double.parseDouble(lat) *1E6;
double dLongotitue =Double.parseDouble(longit) * 1E6;
int iLat = (int) dLat;
int iLongtitue = (int) dLongotitue;
point = new GeoPoint(iLat, -iLongtitue);
System.out.println("point length::" +point);
System.out.println("point length::" +title);
System.out.println("point length::" +address);
OverlayItem overlayitem = new OverlayItem(point, title,address);
itemizedoverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedoverlay);
}