2014-11-20 2 views
1

세슘 API에 따르면 자산의 광고판 (또는 라벨)의 가시성을 전환하려면 단순히 billboard.show 속성을 false로 할당하면됩니다. 내가이 일을 시도 할 때, 세슘은 세슘 dev에 구글 그룹에서CZML 엔터티의 광고 게시판의 공개 속성 (billboard.show)을 전환하는 방법은 무엇입니까?

An error occurred while rendering. Rendering has stopped. 
TypeError: undefined is not a function 
... 

This discussion와 오류 할 것은 /에 광고판의 가시성을 전환하는 몇 가지 예제 코드가 포함되어 있습니다. CZML의 엔티티에서 show = false를 시도하면 동일한 코드가 작동하지 않습니다 (이 예는 CZML을 사용하지 않습니다). 여기

내가

var asset = loadedCZML.entities.getById(id); 
asset.billboard.show = false; //Error! 

뭘하려 (loadedCZML 인 Cesium.CzmlDataSource)

답변

1

은 API 문서의하지 당신의 엔티티의 show 속성은 항상 간단한 부울 속성을하지 않을 수 있습니다 언급 (로 API가 설명합니다).

CzmlDataSourceentity 작업의 show 속성은 (적어도 내 CZML로했다)를 TimeIntervalCollectionProperty 간주됩니다. 세슘에

모든 속성은 getValue 기능을 구현해야합니다, 당신이 당신의 show = false을 설정 갈 때, 속성에 대한 세터는 TimeIntervalCollectionProperty 거짓 적용 할 수없는 대신 false의 간단한 값으로 전체 속성을 대체합니다.

오류 undefined is not a functionshow 속성에서 getValue()를 호출하려고 시도한 세슘 렌더링 호출의 결과입니다. 에 관계없이, 수정은 간단하다 :이 대신

:

asset.billboard.show = false; //error

이 작업을 수행 :

asset.billboard.show = new Cesium.ConstantProperty(false); 

PS :

:이 다음 예제를 참조하십시오 다른 세슘 속성 적용
entity.billboard.image = pinBuilder.fromColor(Cesium.Color.CRIMSON, 48); //error 

//do this instead 
entity.billboard.image = new Cesium.ConstantProperty(pinBuilder.fromColor(Cesium.Color.CRIMSON, 48).toDataURL()); 
관련 문제