2014-07-16 3 views
2

안녕하세요 저는 현재 Google지도를 Android에서 사용하고 있습니다. 나는 위도, 경도의 목록을 검색하고 MySQL 데이터베이스에서 값을 니펫을 구글 maps.This에 지금 시도 코드를 보여 주려하지만 나는Google지도에서 asynctask의 여러 마커로드

public static ArrayList<HashMap<String,Double>> vehiclehistory1= new ArrayList<HashMap<String,Double>>(); 
double latitude; 
double longitude; 
for(int i=0;i<user.length();i++) 
{ 
    System.out.println("forloop i valuie"+i); 
    JSONObject c1 = user.getJSONObject(i); 
    JSONObject c2 = c1.getJSONObject(TAG_SRES); 

    vehicle_reg_numb = c2.getString(TAG_Vechicle_REG); 
    latitude= c2.getDouble(TAG_Latitude); 
    longitude = c2.getDouble(TAG_Longitude); 
    speed = c2.getString(TAG_Speed); 
    exceed_speed_limit=c2.getString(TAG_Exceed_Speed); 
    bus_tracking_timestamp = c2.getString(TAG_bus_tracking_timestamp); 
    address=c2.getString(TAG_address); 
    map1.put(TAG_Latitude,latitude); 
    map1.put(TAG_Longitude,longitude); 
    map.put(TAG_Speed, speed); 
    map.put(TAG_address, address); 

    vehiclehistory1.add(map1); 
    vehiclehistory.add(map); 

} 
@Override 
protected void onPostExecute(String file_url) { 

    super.onPostExecute(file_url); 
    cDialog.dismiss(); 
    for (int i = 0; i < vehiclehistory1.size(); i++) { 
     LatLng pinLocation = new LatLng(Float.parseFloat(vehiclehistory1.get(i).latitude), Float.parseFloat(vehiclehistory1.get(i).longitude)); 
     Marker storeMarker = map.addMarker(new MarkerOptions() 
      .position(pinLocation) 
      .title(vehiclehistory1.get(i).pinname) 
      .snippet(vehiclehistory1.get(i).address) 
     ); 
    } 
} 

내가지도에 마커를 얻을 did't Wher 위도를 얻는 것은 해결되지 않은 타입입니다. 내가 실수 한 부분을 누구에게 말해 줄 수 있습니까?

답변

1

이고요 you..I 그와 시도 감사 @MD이 대신 구문 분석 플로트의

LatLng pinLocation = new LatLng(Double.parseDouble(vehiclehistory1.get(i).latitude), Double.parseDouble(vehiclehistory1.get(i).longitude)); 

Latitude에 대한 Double을 사용

방법 및 Longitude

+0

을 시도 모두가 가야 위도와 경도가 될 수 없습니다 무엇입니까 해결되었거나 현장이 아님 – micky

+0

@micky 위도와 경도를 String으로 저장하고 있습니까? –

+0

더블이 없습니다 .... – micky