Methods
changeOrder(reference, forward, srcIndex, srcIndex)
그래픽 객체 렌더링 순서를 변경한다.
Parameters:
Name | Type | Description |
---|---|---|
reference |
object | 기준 투명도 객체 |
forward |
bool | 위로, 아래로 |
srcIndex |
number | src Index |
srcIndex |
dstIndex | dst Index |
createObject(prop, style) → {object}
- See:
ObjectProp, ObjectStyle 정보로 그래픽 객체를 생성한다.
ex) 좌표열로 그래픽 객체를 생성 할 경우 사용한다.
Example
// 그래픽 레이어를 생성 한 후 좌표열로 폴리라인 그래픽 객체 생성 예
var index = graphic.addGraphicAppBoard();
var board = graphic.getGraphicBoard(index);
var polylineProp = new D2.Core.GraphicObjectProp('polyline');
var polylineStyle = new D2.Core.GraphicObjectStyle();
polylineProp.setCoordinate([[13975753, 4699927], [13976013, 4664939], [13988264, 4667396], [13984675, 4631340]]);
var polylineObject = board.createObject(polylineProp, polylineStyle);
polylineObject.createFeature(true);
Parameters:
Name | Type | Description |
---|---|---|
prop |
ObjectProp | 그래픽 객체 타입(point, marker, polyline, rectangle, ellipse, arc, image, group, milSymbol 중 택일) 및 속성 정보 |
style |
ObjectStyle | 그래픽 객체 스타일 설정 |
Returns:
prop.type에 따른 그래픽 객체 반환
- Type
- object
exportJSONfor3D() → {object}
3D 중첩을 위해 객체정보를 JSON 형식의 오브젝트로 반환한다.
Example
var board = this.graphic.getSelectGraphicBoard();
if (board) {
var json = board.exportJSONfor3D();
GraphicUtil.download(json, 'graphic.json', 'text/plain');
}
Returns:
JSON 형식에 객체정보 반환
- Type
- object
getGUID() → {string}
GUID(Globally Unique Identifier)를 반환한다.
Returns:
GUID
- Type
- string
getObjectInExtent(extend) → {array}
주어진 extend 영역으로 검색된 그래픽 객체를 반환한다.
Example
let extent = [13937017, 4524333, 14061151, 4635014];
let selectFeature = board.getObjectInExtent(extent);
Parameters:
Name | Type | Description |
---|---|---|
extend |
object | MBR(Minimum bounding box) 배열 |
Returns:
그래픽 객체 배열
- Type
- array
getObjectList() → {array}
그래픽 객체를 배열로 반환한다.
Returns:
그래픽 객체 배열
- Type
- array
getOLLayer() → {ol/VectorLayer}
OL 레이어를 반환한다.
Returns:
OL VectorLayer
- Type
- ol/VectorLayer
getOLSource() → {ol/vectorSource}
OL 소스를 반환한다.
Returns:
OL VectorSource
- Type
- ol/vectorSource
getParentObjectList() → {array}
최상위 그래픽 객체를 배열로 반환한다.
Returns:
그래픽 객체 배열
- Type
- array
removeAllObject(index)
모든 그래픽 객체를 삭제한다.
Parameters:
Name | Type | Description |
---|---|---|
index |
number | 인덱스 |
removeObject(index)
getObjectList()의 인덱스로 객체를 삭제한다.
Parameters:
Name | Type | Description |
---|---|---|
index |
number | 인덱스 |