PopupProperty

객체 속성 표시 팝업 클래스.
A Pop-up that shows the properties of an object.

new Ditap.PopupProperty(options)

Name Type Description
options object 다음과 같은 속성을 가진 객체.
Object with the following properties:
Name Type Description
viewer DitapViewer optional 사용할 Ditap Viewer 인스턴스.
he DitapViewer instance to use.
selectedObject object optional 선택된 객체.
The selected object.
properties Array.<string> optional 선택 객체의 속성.
The properties of selected object.
propertyCallback function optional 속성 콜백 함수.
property callback Function.
Example:
const viewer = new Ditap.DitapViewer("ditapContainer");

const position1 = new Ditap.Cartesian3.fromDegrees(
  126.97759025002786,
  37.56679755138474
);
const position2 = new Ditap.Cartesian3.fromDegrees(
  126.97764810657144,
  37.566518888624664
);

// LinestringEntity instance 생성
const linestringEntity = new Ditap.LinestringEntity(viewer, [
  position1,
  position2,
]);

const linestringEntityProperty = 
    {
       properties: {
         id: "line2",
         position1 : position1,
         position2 : position2
       }
    };

// 비동기로 속성값을 요청하는 promise를 반환하는 함수
function getPropertiesPromise(selectedObject) {
  // 첫번째 파라미터로 받은 선택된 객체 인스턴스를 활용하여 콜백함수 작성
  if (!selectedObject) {
    return;
  }
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve([
        {
          title: "newObject",
          properties: {
            name: "objectName",
            content: "objectContent",
          },
        },
        {
          title: "newObject2",
          properties: {
            name: "objectName2",
            content: "objectContent2",
          },
        },
      ]);
    }, 2000);
  });
}

const popup = new Ditap.PopupProperty(
  {
    viewer: viewer,
    selectedObject: linestringEntity,
    properties: [linestringEntityProperty],
    propertyCallback: getPropertiesPromise,
  });

Extends

Members

readonly properties : object

엔티티의 속성.
Properties of the entity.

readonly selectedObject : Entity

속성 조회 할 엔티티.
Entitiy to query for properties.

Methods

appendContent(element)

컨텐츠 영역에 요소 추가.
Append element to content.
Name Type Description
element Element 추가할 요소.
Element to add.
Inherited From:

appendFooter(element)

푸터 영역에 요소 추가.
Append element to footer.
Name Type Description
element Element 추가할 요소.
Element to add.
Inherited From:

appendHeader(element)

헤더 영역에 요소 추가.
Append element to header.
Name Type Description
element Element 추가할 요소.
Element to add.
Inherited From:

close(element)

팝업 닫기.
Close popup.
Name Type Description
element Element 매개변수가 없는 경우 wrapper 오픈.
If no parameter is entered, close wrapper.

destroy()

이 객체의 모든 리소스 제거.
Remove all resources of this object.
Inherited From:

open(element)

팝업 열기.
Open popup.
Name Type Description
element Element 매개변수가 없는 경우 wrapper 오픈.
element If no parameter is entered, open wrapper.
Inherited From:

prependContent(element)

컨텐츠 영역 맨 앞에 요소 추가.
Prepend element to content.
Name Type Description
element Element 추가할 요소.
Element to add.
Inherited From:

prependFooter(element)

푸터 영역 맨 앞에 요소 추가.
Prepend element to footer.
Name Type Description
element Element 추가할 요소.
Element to add.
Inherited From:

prependHeader(element)

헤더 영역 맨 앞에 요소 추가.
Prepend element to header.
Name Type Description
element Element 추가할 요소.
Element to add.
Inherited From:

removeAllContent()

컨텐츠 영역의 모든 자식 요소 제거.
Remove all children of content.
Inherited From:

removeAllFooter()

푸터 영역의 모든 자식 요소 제거.
Remove all children of footer.
Inherited From:

removeAllHeader()

헤더 영역의 모든 자식 요소 제거.
Remove all children of header.
Inherited From:

removeContent(element)

컨텐츠 영역의 자식 요소 제거.
Remove children of content.
Name Type Description
element Element 제거할 요소.
Element to remove.
Inherited From:

removeFooter(element)

푸터 영역의 자식 요소 제거.
Remove children of footer.
Name Type Description
element Element 제거할 요소.
Element to remove.
Inherited From:

removeHeader(element)

헤더 영역의 자식 요소 제거.
Remove children of header.
Name Type Description
element Element 제거할 요소.
Element to remove.
Inherited From:

runPropertyCallback(properties)

Run property Callback function.
Name Type Description
properties object The properties of Entity

toggle(element)

팝업 활성화 on/off 기능.
Function on and off.
Name Type Description
element Element 매개변수가 없는 경우 wrapper 오픈.
If no parameter is entered, toggle wrapper.
Inherited From: