GeOnDT GeOnDT for JS

Class: U2dVectorShaderLayer

U2dVectorShaderLayer

~extends U3dImageLayer
화면에 2D Vector를 생성하는 클래스 (shader material 사용)

new U2dVectorShaderLayer(opt)

Name Type Description
opt U2dVectorShaderLayerCO
Tutorials:

Members

OPT_KEYS

Methods

addGeometry(geom)

파라미터롤 받은 Geometry 객체를 추가하는 함수

Name Type Description
geom U2dGeometry

추가할 2D Geometry 객체

addGeometryAsGeojson(json, sourceCRS, callback)Promise.<void>

Geojson을 읽어 Geometry 객체를 추가하는 함수

Name Type Description
json object

읽어올 Geojson Object

sourceCRS string optional

Geojson source의 CRS(Projection)

callback function optional

피쳐생성후 호출될 콜백, 생성된 피쳐가 파라메터로 넘겨집니다.

Returns:
Type Description
Promise.<void> promise

addGeometryAsTopojson(json, sourceCRS, callback)Promise.<void>

TopoJson 파일을 읽어 Geometry 객체를 추가하는 함수

Name Type Description
json string | array

읽어올 TopoJson

sourceCRS string optional

TopoJson source의 CRS(Projection)

callback function optional

피쳐 생성 후 호출될 콜백, 생성된 피쳐가 파라메터로 넘겨집니다.

Returns:
Type Description
Promise.<void> promise

addGeometryAsWKT(wkt, sourceCRS, callback)Promise.<void>

WKT를 읽어 Geometry 객체를 추가하는 함수

Name Type Description
wkt string | array

WKT 문자열

sourceCRS string optional

WKT source의 CRS(Projection)

callback function optional

피쳐생성후 호출될 콜백, 생성된 피쳐가 파라메터로 넘겨집니다.

Returns:
Type Description
Promise.<void> promise

addTileFromScene(tile)boolean

입력받은 타일을 화면에(scene)에 추가하는 함수

Name Type Description
tile U3dQuadTile

타일

Returns:
Type Description
boolean 작업 성공 여부. 성공하면 true, 실패면 false.

clearLabel()

전체 라벨을 제거하는 함수

async createTexture(tile)Promise.<void>

WFS tile 응답 또는 기존 cache를 terrain decal payload로 변환합니다. base texture가 없는 runtime tile은 표시 전 payload를 prewarm합니다.

Name Type Description
tile U3dQuadTile

타일

Returns:
Type Description
Promise.<void>

dispose()ReturnType.<Class.<deferred>>

Returns:
Type Description
ReturnType.<Class.<deferred>>

getBoundingBox()Box3

레이어의 바운딩박스(Box3)를 반환하는 함수

Returns:
Type Description
Box3

getDebugTileState(tileKey)U2dVectorShaderLayer~DebugTileState|undefined

tile 상태 debug 용

Name Type Description
tileKey string

확인하려는 tile의 key값

Returns:
Type Description
U2dVectorShaderLayer~DebugTileState | undefined

getFeatureById(id)UMeasureFeature|undefined

Name Type Description
id string | number
Returns:
Type Description
UMeasureFeature | undefined

getFeatureByUid(uid)UMeasureFeature|undefined

Name Type Description
uid string
Returns:
Type Description
UMeasureFeature | undefined

getFeatureByXY(x, y)UMeasureFeature

위경도 좌표를 받아서 해당 위치의 feature를 반환

Name Type Description
x GeoPosition.x

경도

y GeoPosition.y

위도

Returns:
Type Description
UMeasureFeature 입력 받은 위치에 해당하는 feature 정보

getFeatures()Array

U2dVectorShaderLayer의 Feature 목록을 반환하는 함수

Returns:
Type Description
Array Feature 목록

getGeometries()Array.<UMeasureFeature>

생성된 전체 2D Geometry 객체 목록을 반환하는 함수

Returns:
Type Description
Array.<UMeasureFeature> 2D Geometry 객체 목록

getIntersects(u2dGeometry)Array.<U2dGeometry>|undefined

파라미터로 입력받은 U2dGeometry와 교차되는 2D Geometry 객체를 반환하는 함수

Name Type Description
u2dGeometry U2dGeometry

교차 검색할 대상 U2dGeometry

Returns:
Type Description
Array.<U2dGeometry> | undefined
Example
vectorLayer.getIntersects(new Union3D.geom.U2dPoint().setPosition([126.94215165535197, 37.519650370480015]));
Returns:
Type Description
U2dVectorShaderLayer~U2dVectorShaderLayer_SimplifyInfo

getVectorExtent()Box3|undefined

Returns:
Type Description
Box3 | undefined

hide(refresh)

U2dVectorShaderLayer hide 함수 vector layer 소유 source payload만 제거하고 다른 source와 terrain mesh visibility는 유지합니다.

Name Type Description
refresh boolean optional

hideLabel()

U2dVectorShaderLayer 전체 라벨을 hide하는 함수

initialize()void

앱 공유 terrain manager와 이 레이어가 소유한 shader cache manager를 연결합니다.

Returns:
Type Description
void 반환값이 없습니다.

isDataExist()boolean

Returns:
Type Description
boolean

logDebugTileState(tileKey)U2dVectorShaderLayer~DebugTileState|undefined

Name Type Description
tileKey string
Returns:
Type Description
U2dVectorShaderLayer~DebugTileState | undefined

processMaterial(tile, features, index)

Name Type Description
tile U3dQuadTile
features Array.<object>
index number optional

refreshTerrainDynamicCircleRadius(opt)boolean

카메라 거리에 따라 동적 원형 feature 반경을 다시 계산하고 연결된 tile만 갱신합니다.

Name Type Default Description
opt object {} optional

반경 갱신 옵션입니다.

Name Type Default Description
radius number optional

화면 기준 반경입니다.

reset boolean false optional

원래 geometry 반경으로 복원할지 여부입니다.

deferFlush boolean true optional

tile rebuild를 다음 flush까지 미룰지 여부입니다.

Returns:
Type Description
boolean 하나 이상의 tile payload가 변경되었으면 true입니다.

removeGeometry(geom)

사용자 feature 제거 시 runtime payload와 local tile 바인딩을 함께 정리해 잔상 decal을 막습니다.

Name Type Description
geom U2dGeometry

추가할 2D Geometry 객체

removeHigLight(geom)

Name Type Description
geom U2dGeometry

removeHigLightAll()

highlight 상태인 feature들의 highlight를 해제합니다.

removeLabel(targetGeom)

지정한 2D 객체의 라벨을 제거하는 함수

Name Type Description
targetGeom Object | *

라벨을 제거할 2D 객체 (ex: U2dPoint, U2dLine, U2dPolygon...)

removeTileFromScene(tile)boolean

화면(scene)에서 입력받은 타일을 제거하는 함수

Name Type Description
tile U3dQuadTile

타일

Returns:
Type Description
boolean 작업 성공 여부. 성공하면 true, 실패면 false.

renderTile(tile, isForce)

Name Type Description
tile U3dQuadTile
isForce boolean

setDynamicRadius(value, radius)U2dVectorShaderLayer

circle type 에 대한 동적 반경 사이즈를 설정하는 함수

Name Type Default Description
value boolean

사동적 반경 용 여부. true면 사용, false면 사용 안함.

radius number 8 optional

반경 크기

Returns:
Type Description
U2dVectorShaderLayer 현재 레이어입니다.

setFeatureStyle(feature, style)

feature를 입력 받아 해당 feature의 style을 설정하는 함수

Name Type Description
feature UMeasureFeature

style을 수정하려는 대상

style object

style 수정 내용

setHighLight(geom, opt)

Name Type Description
geom U2dGeometry
opt object optional

하이라이트 스타일입니다.

Name Type Description
fillColor ColorRepresentation optional

채우기 색상입니다.

fillOpacity number optional

채우기 투명도입니다.

strokeColor ColorRepresentation optional

외곽선 색상입니다.

strokeOpacity number optional

외곽선 투명도입니다.

strokeWidth number optional

외곽선 두께입니다.

opacity number optional

개별 투명도가 없을 때 사용할 공통 투명도입니다.

setLabel(targetGeom, label, zOffset)

지정한 2D 객체에 라벨을 붙이는 함수

Name Type Description
targetGeom Object | *

라벨을 붙일 2D 객체 (ex: U2dPoint, U2dLine, U2dPolygon...)

label String

라벨

zOffset Number

라벨 z축 offset

setOpacity(val)

레이어 투명도를 설정하는 메서드 입니다.

Name Type Description
val number

투명도 (0~1)

setSimplifyValue(type, property, minValue, maxValue)

Name Type Description
type 'line' | 'polygon'
property 'level' | 'tolerance' | 'size'
minValue number
maxValue number

setStyle(opt)Promise

U2dVectorShaderLayer 전체 2D 객체들의 스타일을 설정하는 함수

Name Type Description
opt

스타일 옵션

Name Type Description
fillColor

2D 객체 채우기 색

strokeColor

2D 객체 외곽선 색

strokeWidth

2D 객체 외관선 두께

Returns:
Type Description
Promise promise

setStyleFunction(styleFunction)Promise.<void>

layer style function을 교체하고 cache feature의 style payload를 갱신합니다.

Name Type Description
styleFunction function

style을 지정하려는 함수

Returns:
Type Description
Promise.<void>

setVectorExtent()

show(show, refresh)

U2dVectorShaderLayer show 함수 vector layer를 표시하고 현재 tile cache에서 이 layer 소유 source payload를 복원합니다.

Name Type Default Description
show boolean true optional
refresh boolean optional

showLabel()

U2dVectorShaderLayer 전체 라벨을 show하는 함수

update(drawArg, curTime)

Name Type Description
drawArg UDrawArg
curTime number

updateFeatures()

전체 2D Geometry 객체를 제거하고 레이어를 비우는 함수