2014-12-18 4 views
4

Google지도의 GMSIndoorDisplay 클래스를 사용하고 있습니다. 기본 층으로 뷰를 설정할 수 있습니다. 사용자는 바닥 목록에서 바닥을 눌러 바닥을 변경할 수 있습니다. 기존에로드 된 ViewController에서 프로그래밍 방식으로 바닥 변경을 강제하는 방법이 있습니까?GMSIndoorDisplay : 특정 층으로 변경하는 방법

답변

1

나는 그것을 할 방법을 찾았습니다. didChangeActiveBuilding (무효) - : (GMSIndoorBuilding를

- (void) didChangeActiveBuilding:  (GMSIndoorBuilding *) building [optional] 

이 방법은, 다음 대표가 자동으로 트리거됩니다 : 현재의 건물 객체를 저장하여 우리는 대리인에게 전화를 강제로 다음 GMSIndoorDisplay의 활성 수준을 변경할 수 있습니다 *) 건물 [선택 사항]

- (void) didChangeActiveLevel:  (GMSIndoorLevel *) level [optional] 
+0

조금 더 명확하게 설명 할 수 있습니까? 대의원이 방을 바꾸도록 강제 할 수 있습니까? – derdida

0

불행히도 당신이 할 수없는 것처럼 보입니다. 각 건물에는 피커가 처음 표시 될 때 선택되는 기본 바닥이 있습니다.

+0

Verma, 나는 해결책을 찾았습니다. anwser를보십시오. 대답 주셔서 감사합니다 – user3538463

0

잘하면 건물의 모든 층과 현재 선택된 층이 있어야합니다.

- (void)mapViewDidFinishTileRendering:(GMSMapView *)mapView { 
    if(!selectlevel) 
     selectlevel = mapView.indoorDisplay.activeBuilding.defaultLevelIndex; 
    allLevels = mapView.indoorDisplay.activeBuilding.levels; 
} 

- (void)down:(id)down { 
    if(selectlevel>0){ 
     selectlevel = selectlevel -1; 
     mapView.indoorDisplay.activeLevel = allLevels[selectlevel]; 
    } 
} 

- (void)up:(id)up { 
    if(selectlevel< [allLevels count] -1){ 
     selectlevel = selectlevel +1; 
     mapView.indoorDisplay.activeLevel = allLevels[selectlevel]; 
    } 
} 
관련 문제