for (int i = 0; i < 30; i++) {
// 날씨 데이터를 추출
s += "" + i + ": 위치정보: ";
Node node = nodeList.item(i); // data엘리먼트 노드
Element fstElmnt = (Element) node;
NodeList nameList = fstElmnt.getElementsByTagName("addr");
Element nameElement = (Element) nameList.item(0);
nameList = nameElement.getChildNodes();
s += ((Node) nameList.item(0)).getNodeValue() + " ,";
NodeList websiteList = fstElmnt
.getElementsByTagName("yadmNm");
// <wfKor>맑음</wfKor>
s += "병원이름 = "
+ websiteList.item(0).getChildNodes().item(0)
.getNodeValue() + "\n";
NodeList lon = fstElmnt.getElementsByTagName("XPos");
NodeList lat = fstElmnt.getElementsByTagName("YPos");
NodeList distance = fstElmnt.getElementsByTagName("distance");
NodeList phone = fstElmnt.getElementsByTagName("telno");
String tel ="";
tel = phone.item(0).getChildNodes().item(0).getNodeValue();
//밑에병원리스트추가
personList.add(new Person(websiteList.item(0).getChildNodes().item(0)
.getNodeValue(), "전화번호 : " + "("
+ tel+ ")",""));
Log.i("map", "아무값도안뜨는데");
Log.i("01-13",
calcDistance(
wichy,
wichx,
Double.parseDouble(lat.item(0).getChildNodes()
.item(0).getNodeValue()),
Double.parseDouble(lon.item(0).getChildNodes()
.item(0).getNodeValue())));
drawMarkeraround(
lon.item(0).getChildNodes().item(0).getNodeValue(),
lat.item(0).getChildNodes().item(0).getNodeValue(),
websiteList.item(0).getChildNodes().item(0)
.getNodeValue(),
distance.item(0).getChildNodes().item(0)
.getNodeValue(), i);
private void drawMarkeraround(String x, String y, String name, String meter,int i) {
ins = i;
// 기존 마커 지우기
wichx = Double.parseDouble(x);
wichy = Double.parseDouble(y);
Log.i("map", "drawmakretaround x : " + String.valueOf(wichx));
Log.i("map", "drawmakretaround y : " + String.valueOf(wichy));
LatLng currentPosition = new LatLng(wichy, wichx);
// currentPosition 위치로 카메라 중심을 옮기고 화면 줌을 조정한다. 줌범위는 2~21, 숫자클수록 확대
// map.moveCamera(CameraUpdateFactory.newLatLngZoom(currentPosition,
// 17));
// map.animateCamera(CameraUpdateFactory.zoomTo(17), 2000, null);
// 마커 추가
map.addMarker(new MarkerOptions()
.position(currentPosition)
.snippet(meter)
.icon(BitmapDescriptorFactory
.defaultMarker(BitmapDescriptorFactory.HUE_AZURE))
.title(name));
map.setOnMarkerClickListener(new OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker marker) {
Toast.makeText(getApplicationContext(), String.valueOf(ins)+"번째"+"aaa", Toast.LENGTH_SHORT).show();
return false;
}