* 고객, 상점, 배달기사의 위치를 저장
GMSCoordinateBounds* boundsMarker = [[GMSCoordinateBounds alloc] init];

// google map marker. 배송지 위치
if(gmsMarkerCustomer == nil) gmsMarkerCustomer = [[GMSMarker alloc] init];
gmsMarkerCustomer.position = CLLocationCoordinate2DMake(thriftLatLngCustomer.lat, thriftLatLngCustomer.lng);
gmsMarkerCustomer.title = @"고객님의 위치";
gmsMarkerCustomer.appearAnimation = kGMSMarkerAnimationPop;
gmsMarkerCustomer.icon = [UIImage imageNamed:@"mappin_user"];
gmsMarkerCustomer.map = gmsMapView;
boundsMarker = [boundsMarker includingCoordinate:gmsMarkerCustomer.position];

// google map marker. 상점 위치
if(gmsMarkerStore == nil) gmsMarkerStore = [[GMSMarker alloc] init];
gmsMarkerStore.position = CLLocationCoordinate2DMake(thriftLatLngStore.lat, thriftLatLngStore.lng);
gmsMarkerStore.title = @"상점의 위치";
gmsMarkerStore.appearAnimation = kGMSMarkerAnimationPop;
gmsMarkerStore.icon = [UIImage imageNamed:@"mappin_store"];
gmsMarkerStore.map = gmsMapView;
boundsMarker = [boundsMarker includingCoordinate:gmsMarkerStore.position];

// google map marker. 배달기사 위치
if(gmsMarkerAgent == nil) gmsMarkerAgent = [[GMSMarker alloc] init];
gmsMarkerAgent.position = CLLocationCoordinate2DMake(thriftLatLngAgent.lat, thriftLatLngAgent.lng);
gmsMarkerAgent.title = @"배달기사의 위치";
gmsMarkerAgent.appearAnimation = kGMSMarkerAnimationPop;
gmsMarkerAgent.icon = [UIImage imageNamed:@"mappin_store"];
gmsMarkerAgent.map = gmsMapView;
boundsMarker = [boundsMarker includingCoordinate:gmsMarkerAgent.position];

// 배송지위치, 상점위치, 배달기사위치가 모두 보이도록 지도 조정
GMSCameraUpdate* gmsCameraUpdate = [GMSCameraUpdate fitBounds:boundsMarker withPadding:30.0];[gmsMapView animateWithCameraUpdate:gmsCameraUpdate];



반응형

'iOS 초보' 카테고리의 다른 글

status bar 객체 얻기  (0) 2015.04.07
UIActivityViewController, 카카오링크 연동  (0) 2015.04.03
autolayout 제약조건 애니메이션  (0) 2015.03.18
맥, ios, thrift  (0) 2015.03.12
autolayout, 제약조건 동적 생성  (0) 2015.02.16
Posted by 돌비
,