1. valueEventListener 로 각 영화관 노드의 위치값들을 받아옵니다.
for(Datasnapsoht snapshot : datasnapshot.getchildre()){
Theater theater = snapshot.getValue(Theater.class);
setMarker(theater);
}
2. setMarker메소드에서 DB로부터 받아온 위도,경도, 이름등을 꺼내서 마커를 만들어 추가해 줍니다.
public void setMarker(Theater theater){
double lat = theater.getlatitude();
double lon = theater.getlongitude();
LatLng latlng = new LatLng(lat, lon);
String name = theater.getname();
MarkerOptionsmarkerOptions = new MarkerOptions();
if(name.equals("CGV"){
markerOptions.icon(아이콘1);
}else{
markerOptions.icon(아이콘2);
}
markerOptions.position(latlng);
mGoogleMap.addMarker(markerOptions);
}