API
ShapeAnnotation

ShapeAnnotation extends Annotation

Shape Annotation 모델.
type'shape'이고, 설정 모델은 ShapeAnnotationOptions이다.

Properties

name: string (opens in a new tab) readonly

아이템 이름.
동적으로 아이템을 다루기 위해서는 반드시 지정해야 한다.

default :undefined

visible: boolean (opens in a new tab) readonly

표시 여부.
options.visible 값을 그대로 return하는 것이 아니라, undefinednull 등으로 지정하는 경우 모델의 상태에 따라 truefalse로 해석될 수 있다.
설정의 경우 updateOptions({visible: value})로 지정하는 것과 동일하다.

default :undefined

Methods

clearOptions(render?): ShapeAnnotation

명시적으로 설정된 모든 모델 설정 값들을 제거한다.

ParameterTypeDescription
render=trueboolean (opens in a new tab)true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본갑 true

return 모델 객체 자신

clearStyle(render?): ShapeAnnotation

명시적으로 모델에 설정된 모든 style 값들을 제거한다.

ParameterTypeDescription
render=falseboolean (opens in a new tab)true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본값 false

destroy(): null

객체가 소유한 참조 등을 해제하고 null을 리턴한다.

list = lis.destroy();

return null

refresh(): void (opens in a new tab)

처음 표시될 때 실행될 에니메이션 설정 정보.

removeOption(prop, render?): ShapeAnnotation

명시적으로 설정된 모델 설정 값을 제거해서 모델의 기본 값이 적용되도록 한다.

ParameterTypeDescription
propkeyof (opens in a new tab) ShapeAnnotationOptions설정 항목 이름
render=trueboolean (opens in a new tab)true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본갑 true

return 모델 객체 자신

setStyle(prop, value, render?): ShapeAnnotation

모델 css style 값을 변경한다.
value에 undefinednull, ''을 지정하면 기존에 설정됐던 스타일 항목이 제거된다.

ParameterTypeDescription
propstring (opens in a new tab)css 스타일 항목 이름.
valueany (opens in a new tab)적용할 스타일 값.
render=trueboolean (opens in a new tab)true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본값 true

setStyles(props, clear?, render?): ShapeAnnotation

여러 항목의 모델 css style 값들을 json 객체로 지정해서 동시에 변경한다.
value에 undefinednull, ''을 지정하면 기존에 설정됐던 스타일 항목이 제거된다.

ParameterTypeDescription
propsobject (opens in a new tab)스타일 항목들과 값들이 설정된 json 객체
clear=falseboolean (opens in a new tab)true로 지정하면 기존 스타일 값을 모두 제거한다. 기본값 false
render=trueboolean (opens in a new tab)true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본값 true

toggleOption(prop, render?): ShapeAnnotation

boolean (opens in a new tab) 타입의 모델 설정 값을 반대 값으로 변경한다.

ParameterTypeDescription
propkeyof (opens in a new tab) ShapeAnnotationOptions설정 항목 이름
render=trueboolean (opens in a new tab)true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본갑 true

return 모델 객체 자신

updateOption(prop, value, render?, force?): ShapeAnnotation

하나의 속성 값을 설정한다.
여러 속성들을 한꺼번에 변경할 때는 updateOptions를 사용한다. 기본적으로 이전 값과 다른 경우에만 적용된다. 특히, 속성값이 객체인 경우 객체 속성만 바뀐 경우 적용되지 않는다. 바꾸고 싶다면 force 매개변수를 true로 지정해서 호출한다.
또, prop 매개변수가 하위 모델 이름인 경우 하위 모델의 updateOptions를 호출한 것과 동일하다.

ParameterTypeDescription
propkeyof (opens in a new tab) ShapeAnnotationOptions설정 항목 이름
valueany (opens in a new tab)설정 값
render=trueboolean (opens in a new tab)true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본값: true
force=falseboolean (opens in a new tab)지정한 값이 이전 값과 동일한 경우에도 적용한다. 기본값: false

return 모델 객체 자신

updateOptions(source?, render?): ShapeAnnotation

모델 설정 값들을 변경한다.

ParameterTypeDescription
sourceShapeAnnotationOptions설정 옵션들이 포함된 json 객체
render=trueboolean (opens in a new tab)true로 지정하면 옵션 변경 시 맵차트를 다시 그린다. 기본갑 true

return 모델 객체 자신