GeOnDT GeOnDT for JS

Class: UDraw

UDraw

~extends UEventDispatcher
지도상에 마우스 클릭으로 Point점, LineString선, Polygon면을 그리는 그리기 모듈 클래스
그린 도형 객체는 ol.Feature를 인터페이스로 사용한다.

new UDraw(options)

Name Type Default Description
options UDraw~UDrawCO {} optional
Example
var draw = new GeOnDT.UDraw();
draw.setApp(app); // GeOnDT.U3dAPP 인스턴스 설정
draw.active();
draw.setGeometryType('Point');

Members

clickClicknumber

drawFeatureOLFeature

drawStyleOLStyle

geometryTypestring

isActiveboolean

labelstring UDraw~LabelFn undefined

labelGroupUGroup

labelPositionstring

nodeLabelstring UDraw~LabelFn undefined

nodeLabelGroupUGroup

statestring

styleOLStyle

wgs84FeatureOLFeature

외부 노출용 EPSG:4326 Source

Methods

active()

그리기 모듈 활성화 함수
클릭, 더블클릭 이벤트 리스너를 등록한다.

addFeature(feature)

Feature 추가 함수 Feature의 좌표계는 EPSG:4326을 사용해야한다.

Name Type Description
feature OLFeature

추가할 Feature

clear()

그려진 모든 Feature를 제거하는 함수.

deactive()

그리기 모듈 비활성화 함수
클릭, 더블클릭 이벤트 리스너를 삭제한다. 이미 그려진 Feature는 지워지지 않는다.

dispose()

UDraw dispose 함수

editLabel(feature, text)

Feature의 라벨을 수정하는 함수

Name Type Description
feature OLFeature

라벨을 지정할 Feature

text string

라벨 Text

finish()

draw 작업 종료 함수

getClickCount()number

화면 클릭 횟수를 반환하는 함수 (더블클릭 이벤트 발생 시 0으로 초기화)

Returns:
Type Description
number 클릭 횟수

getFeatureById(id)OLFeature|undefined

입력한 ID를 갖는 Feature를 반환하는 함수.

Name Type Description
id string

Feature id (그리기 Feature id는 내부적으로 설정된다.)

Returns:
Type Description
OLFeature | undefined

getFeatures()Array.<OLFeature>

그려진 모든 Feature 목록을 반환하는 함수.

Returns:
Type Description
Array.<OLFeature>

makeFeature(geos, type)OLFeature

Feature 생성 함수 Feature의 좌표계는 EPSG:4326을 사용해야한다.

Name Type Description
geos Array.<number>

새로 생성할 Feature의 좌표

type string

Feature의 Geometry 종류 POINT LINESTRING POLYGON

Returns:
Type Description
OLFeature

makeRawFeature(geos, type, buffersize)OLFeature

Name Type Description
geos Array.<number> | Array.<Array.<number>>
type string
buffersize number optional
Returns:
Type Description
OLFeature

off(event, listener)

이벤트 리스너 제거함수 (start,change,end 이벤트 지원)

Name Type Description
event string
listener function

on(event, listener)string|null

이벤트 리스너 등록함수 (start,change,end 이벤트 지원)

Name Type Description
event string
listener EventCallBack
Returns:
Type Description
string | null

removeFeature(feature)

입력한 Feature를 지도에서 제거하는 함수.

Name Type Description
feature OLFeature

제거할 대상 Feature

removeLabel(feature)

입력한 피쳐의 도형 중앙에 표시되는 라벨을 제거하는 함수

Name Type Description
feature OLFeature

피쳐객체

removeNodeLabel(feature)

입력한 피쳐의 도형 노드에 표시되는 라벨을 제거하는 함수

Name Type Description
feature OLFeature

피쳐객체

setApp(app)

app에 UDraw를 설정하는 함수

Name Type Description
app U3dApp

APP

setDrawStyle(drawStyle)

UDraw draw 스타일을 설정하는 함수

Name Type Description
drawStyle OLStyle

스타일 (ol.style.Style)

setGeometryType(type)

그릴 Feature의 Geometry 종류를 설정하는 함수

Name Type Description
type string

Point LineString Polygon

setStyle(style)

UDraw 스타일을 설정하는 함수

Name Type Description
style OLStyle

스타일 (ol.style.Style)

Type Definitions

GeoPointobject

클릭 이벤트로부터 변환된 지리 좌표

Properties:
Name Type Argument Description
x number

경도(lon)

y number

위도(lat)

z number <optional>

고도

LabelFn()

라벨 생성 함수 시그니처

OLVectorSourceobject

OpenLayers Vector Source 인터페이스 (ol 패키지 타입 미설치 환경 대응)

Properties:
Name Type Description
addFeature function

Feature 추가

removeFeature function

Feature 제거

getFeatures function

모든 Feature 반환

getFeatureById function

ID로 Feature 검색

clear function

모든 Feature 제거

UDrawCOobject

~extends UEventDispatcher~UEventDispatcherCO
UDraw 생성자 옵션

Properties:
Name Type Argument Description
label string | UDraw~LabelFn <optional>

라벨 텍스트 또는 라벨 생성 함수

nodeLabel string | UDraw~LabelFn <optional>

노드 라벨 텍스트 또는 라벨 생성 함수

style OLStyle <optional>

스타일 (ol.style.Style)

drawStyle OLStyle <optional>

그리기 스타일 (ol.style.Style)