Edit
Typedefs
- validateProc ⇒
boolean
validate 프로시져
- geometryProc ⇒
ol.geom.Geometry
geometry 프로시져
- start ⇒
Promise
편집 시작
- end ⇒
void
편집 종료
- isActive ⇒
boolean
편집 활성화 여부
- createCadLayer ⇒
ol.layer.Layer
캐드 편집 레이어 생성
- createSelectionLayer ⇒
ol.layer.Layer
선택 레이어 생성
- getLayerFeatures ⇒
Promise.<Array.<ol.Feature>>
레이어 피쳐 조회
- getLayerFeaturesById ⇒
Promise.<Array.<ol.Feature>>
레이어 피쳐 조회
- addLayerFeatures ⇒
Promise.<number>
레이어 피쳐 추가
- updateLayerFeatures ⇒
Promise.<number>
레이어 피쳐 수정
- removeLayerFeatures ⇒
Promise.<number>
레이어 피쳐 삭제
- createSelectInteraction ⇒
Interaction for selecting vector features. By default, selected features are styled differently, so this interaction can be used for visual highlighting, as well as selecting features for other actions, such as modification or output. There are three ways of controlling which features are selected: using the browser event as defined by the condition and optionally the toggle, add, remove, and multi options; a layers filter; and a further feature filter using the filter option.
- createDrawInteraction ⇒
ol.interaction.Draw
Interaction for drawing vector data. By default, this interaction allows drawing linestrings, polygons, and circles.
- createLinkInteraction ⇒
ol.interaction.Link
Return an interaction that synchronizes the map state with the URL.
- createSnapInteraction ⇒
ol.interaction.Snap
Return an interaction that handles snapping of vector features while modifying or drawing them. The features can come from a ol.source.Vector or ol.Collection Any interaction object that allows the user to interact with the features using the mouse can benefit from the snapping, as long as it is added before.
The snap interaction modifies map browser event
coordinate
andpixel
properties to force the snap to occur to any interaction that them.- createTranslateInteraction ⇒
ol.interaction.Translate
Interaction for translating (moving) features. If you want to translate multiple features in a single action (for example, the collection used by a select interaction), construct the interaction with the
features
option.- getControl ⇒
ol.control.Control
컨트롤 조회
- showControl :
function
컨트롤 표시/숨김
- toJsts ⇒
Promise.<Array.<jsts.Geometry>>
OL 지오메트리를 JSTS 지오메트리로 변환
- fromJsts ⇒
Array.<ol.geom.Geometry>
JSTS 지오메트리를 OL 지오메트리로 변환
- splitJsts ⇒
Array.<jsts.Geometry>
지오메트리 분할
- isPointOnSegment ⇒
boolean
좌표가 선분위에 있는지 판별
- splitLineAtPoint ⇒
Array.<jsts.geom.LineString>
라인스트링을 포인트로 분할
- unionJsts ⇒
jsts.Geometry
지오메트리 합집합
- differenceJsts ⇒
Array.<jsts.Geometry>
지오메트리 차집합
- mergeJsts ⇒
Array.<jsts.geom.Geometry>
지오메트리 병합
validateProc ⇒ boolean
validate 프로시져
Kind: global typedef
Returns: boolean
- true: 편집 허용, false: 편집 금지
Param | Type | Description |
---|---|---|
coordinates | Array.<number> | 클릭 좌표 |
geometry | ol.geom.Geometry | 현재 지오메트리 |
projection | string | 현재 좌표계 |
geometryProc ⇒ ol.geom.Geometry
geometry 프로시져
Kind: global typedef
Returns: ol.geom.Geometry
- 생성된 지오메트리
Param | Type | Description |
---|---|---|
coordinates | Array.<number> | 생성된 좌표 |
geometry | ol.geom.Geometry | 현재 지오메트리 |
projection | string | 현재 좌표계 |
start ⇒ Promise
편집 시작
Kind: global typedef
Param | Type | Default | Description |
---|---|---|---|
options | object | ||
options.showToolbar | boolean | 툴바 표시 여부 | |
options.onDrawClick | validateProc | 그리기 클릭 핸들러 | |
options.onDrawGeometry | geometryProc | 지오메트리 생성 핸들러 | |
[options.map] | ol.Map | 맵 객체 (기본값: this.getMap()) | |
[options.target] | HTMLElement |
| 툴바 렌더링 대상 |
options.editLayer | ol.layer.Vector | 편집 레이어 | |
options.resultLayer | ol.layer.Vector | 결과 레이어 | |
options.lookupLayer | ol.layer.Vector | 조회 레이어 | |
options.selectionLayer | ol.layer.Vector | 선택 레이어 |
Example
await gwsJS.edit.start({
editLayer,
resultLayer,
lookupLayer,
selectionLayer,
showToolbar: true,
target: div,
onDrawClick,
onDrawGeometry,
})
console.log(div.outerHTML.toString())
end ⇒ void
편집 종료
isActive ⇒ boolean
편집 활성화 여부
Kind: global typedef
Returns: boolean
- true: 편집중, false: 편집종료
createCadLayer ⇒ ol.layer.Layer
캐드 편집 레이어 생성
Kind: global typedef
Returns: ol.layer.Layer
- 레이어
Param | Type | Description |
---|---|---|
features | Array.<ol.Feature> | 피쳐 |
options | object | |
[options.title] | string | 레이어 라벨 |
createSelectionLayer ⇒ ol.layer.Layer
선택 레이어 생성
Kind: global typedef
Returns: ol.layer.Layer
- 레이어
Param | Type | Description |
---|---|---|
features | Array.<ol.Feature> | 피쳐 |
options | object | |
[options.title] | string | 레이어 라벨 |
getLayerFeatures ⇒ Promise.<Array.<ol.Feature>>
레이어 피쳐 조회
Kind: global typedef
Returns: Promise.<Array.<ol.Feature>>
- 피쳐
Param | Type | Description |
---|---|---|
gdxName | string | GDX명 |
layerName | string | 레이어명 |
[options] | object | 설정 |
[options.sort] | string | 정렬 설정, ‘+A’: 오른차순 ‘+D’: 내림차순 e.g. ‘id+A,name+D’ |
[options.fields] | string | 조회 필드 설정, 설정할 경우 반드시 geometry 필드를 포함해야 함 e.g. ‘id,name,age,geom’ |
[options.extent] | Array.<double, 4> | 조회 영역 설정 [minx, miny, maxx, maxy] extent가 설정되면 options.filter는 무시됨 |
[options.filter] | string | 조회 필터 설정 e.g. ’ |
[options.projection] | string | 대상 좌표계 설정 |
Example
const features = await gwsJS.edit.getLayerFeatures('kgisEditor_LOCAL.xml', 'fd_pole.loc', {
filter: gwsJS.util.createEqualFilter('mesh_no', SOURCE_ID)
})
getLayerFeaturesById ⇒ Promise.<Array.<ol.Feature>>
레이어 피쳐 조회
Kind: global typedef
Returns: Promise.<Array.<ol.Feature>>
- 피쳐
Param | Type | Description |
---|---|---|
gdxName | string | GDX명 |
layerName | string | 레이어명 |
ids | String | Array.<String> | FID |
[options.projection] | string | 대상 좌표계 설정 |
Example
const features = await gwsJS.edit.getLayerFeaturesById('kgisEditor_LOCAL.xml', 'fd_pole.loc', [
'AAASboAAJAACVy+AAG',
'AAASboAAJAACVy/AAA',
'AAASboAAJAACVy+AAE',
])
addLayerFeatures ⇒ Promise.<number>
레이어 피쳐 추가
Kind: global typedef
Returns: Promise.<number>
- 결과 카운트
Param | Type | Description |
---|---|---|
gdxName | string | GDX명 |
layerName | string | 레이어명 |
features | Array.<ol.Feature> | 피쳐 |
[srsName] | string | 피쳐 좌표계 [기본값: 현재 지도 좌표계] |
[options] | object | |
[options.idgen] | ‘UseExisting’ | null | ID 생성기 [자동: ‘null’, 수동입력: ‘UseExisting’] |
Example
gwsJS.edit.addLayerFeatures('SVC_STLOGIC_LOCAL.xml', 'ac_adm_emd.center_geo', [feature]);
updateLayerFeatures ⇒ Promise.<number>
레이어 피쳐 수정
Kind: global typedef
Returns: Promise.<number>
- 결과 카운트
Param | Type | Description |
---|---|---|
gdxName | string | GDX명 |
layerName | string | 레이어명 |
features | Array.<ol.Feature> | 피쳐 |
[srsName] | string | 좌표계 [기본값: 현재 지도 좌표계] |
Example
gwsJS.edit.updateLayerFeatures('SVC_STLOGIC_LOCAL.xml', 'ac_adm_emd.center_geo', [feature], 'EPSG:3857');
removeLayerFeatures ⇒ Promise.<number>
레이어 피쳐 삭제
Kind: global typedef
Returns: Promise.<number>
- 결과 카운트
Param | Type | Description |
---|---|---|
gdxName | string | GDX명 |
layerName | string | 레이어명 |
features | Array.<ol.Feature> | 피쳐 |
[srsName] | string | 좌표계 [기본값: 현재 지도 좌표계] |
Example
gwsJS.edit.removeLayerFeatures('SVC_STLOGIC_LOCAL.xml', 'ac_adm_emd.center_geo', [feature]);
createSelectInteraction ⇒
Interaction for selecting vector features. By default, selected features are styled differently, so this interaction can be used for visual highlighting, as well as selecting features for other actions, such as modification or output. There are three ways of controlling which features are selected: using the browser event as defined by the condition and optionally the toggle, add, remove, and multi options; a layers filter; and a further feature filter using the filter option.
Kind: global typedef
Returns: ol.interaction.Select
Emits: ol.interaction.Select.event
Param | Type | Default | Description |
---|---|---|---|
options | object | ol.interaction.Select options | |
[options.addCondition] | function | A function that takes an MapBrowserEvent and returns a boolean to indicate whether that event should be handled. By default, this is never. Use this if you want to use different events for add and remove instead of toggle. | |
[options.condition] | function | A function that takes an MapBrowserEvent and returns a boolean to indicate whether that event should be handled. This is the event for the selected features as a whole. By default, this is singleClick. Clicking on a feature selects that feature and removes any that were in the selection. Clicking outside any feature removes all from the selection. See toggle, add, remove options for adding/removing extra features to/ from the selection. | |
[options.layers] | Array.<ol.Layer> | A list of layers from which features should be selected. Alternatively, a filter function can be provided. The function will be called for each layer in the map and should return true for layers that you want to be selectable. If the option is absent, all visible layers will be considered selectable. | |
[options.style] | ol.Style | null | undefined |
[options.removeCondition] | function | A function that takes an MapBrowserEvent and return a boolean to indicate whether that event should be handled. By default, this is never. Use this if you want to use different events for add and remove instead of toggle. | |
[options.toggleCondition] | function | A function that takes an MapBrowserEvent and returns a boolean to indicate whether that event should be handled. This is addition to the condition event. By Default, shiftKeyOnly, i.e. pressing shift as well as the condition event, adds that feature to the current selection if it is not currently selected, and removes it if it is. See add and remove if you want to use different events instead of a toggle. | |
[options.multi] | boolean | false | A boolean that determines if the default behavior should select only single features or all (overlapping) features at the clicked map position. The default of false means single select. |
[options.features] | ol.Collection.<ol.Feature> | Collection where the interaction will place selected features. Optional. If not set the interaction will create a collection. In any case the collection used by the interaction is returned by getFeatures. | |
[options.filter] | ol.interaction.Select.FilterFunction | A function that takes an ol.Feature and an ol.layer.Layer and returns true if the feature may be selected or false otherwise. | |
[options.hitTolerance] | number | 0 | Hit-detection tolerance. Pixels inside the radius around the given position will be checked for features. |
createDrawInteraction ⇒ ol.interaction.Draw
Interaction for drawing vector data. By default, this interaction allows drawing linestrings, polygons, and circles.
Kind: global typedef
Emits: ol.interaction.Draw.event
Param | Type | Default | Description |
---|---|---|---|
[options] | object | ol.interaction.Draw options | |
Geometry | Type | type of the geometries being drawn with this instance. | |
[clickTolerance] | number | 6 | The maximum distance in pixels between “down” and “up” for a “up” event to be considered a “click” event and actually add a point/vertex to the geometry being drawn. The default of 6 was chosen for the draw interaction to behave correctly on mouse as well as on touch devices. |
[features] | ol.Collection.<ol.Feature> | Destination collection for the drawn features. | |
[source] | ol.source.Vector | Destination source for the drawn features. | |
[dragVertexDelay] | number | 500 | Delay in milliseconds after pointerdown before the current vertex can be dragged to its exact position. |
[snapTolerance] | number | 12 | Pixel distance for snapping to the drawing finish. Must be greater than 0. |
[stopClick] | boolean | true | Stop click and singleclick, and doubleclick events from firing during drawing. |
[maxPoints] | number | The number of points that can be draw before a polygon ring or line string is finished. By default there is no restriction. | |
[minPoints] | number | The number of points that must be drawn before a polygon ring or line string can be finished. Default is 3 for polygon rings and 2 for line strings. | |
[finishCondition] | boolean | A function that takes an ol.MapBrowserEvent and returns a boolean to indicate whether the drawing can be finished. Not used when drawing POINT or MULTI_POINT geometries. | |
[style] | StyleLike | FlatStyleLike | Style for the sketch features. The draw interaction can have up to three sketch features, depending on the mode. It will always contain a feature with a Point geometry that corresponds to the current cursor position. If the mode is LineString or Polygon, and there is at least one drawn point, it will also contain a feature with a LineString geometry that corresponds to the line between the already drawn points and the current cursor position. If the mod is Polygon, and there is at least one drawn point, it will also contain a feature with a Polygon geometry that corresponds to the area between the already drawn points and the current cursor position. (note that this polygon has only two points is drawn). If the mode is Circle, and there s one point drawn, it will also contain a feature with a Circle geometry whose center is the drawn point and the radius is determined by the distance between the drawn point and the cursor. | |
[geometryFunction] | GeometryFunction | Function that is called when a new coordinates are updated. | |
[geometryName] | string | Geometry name to use for features created by the draw interaction. | |
[condition] | function | A function that takes an MapBrowserEvent and returns a boolean to indicate whether that event should be handled. By default, noModifierKeys, i.e. a click, adds a vertex or deactivates freehand drawing. | |
[freehand] | boolean | false | Operate in freehand mode for lines, polygons, and circles. This makes the interaction always operate in freehand mode and takes precedence over any freehandCondition option. |
[freehandCondition] | function | Condition that activates freehand drawing for lines and polygons. This function takes an MapBrowserEvent and returns a boolean to indicate whether that event should be handled. By default is shiftKeyOnly, meaning that the Shift key activates freehand drawing. | |
[trace] | boolean | false | Trace a portion of another geometry. Ignored when in freehand mode. |
[traceSource] | ol.source.Vector | Source for features to trace. If tracing is active and a traceSource is not provided, the interaction’s source will be used. Tracing requires that the interaction is configured with either a traceSource or a source. | |
[wrapX] | boolean | false | Wrap the world horizontally on the sketch overlay. |
[geometryLayout] | GeometryLayout | ’XY’ | Layout of the feature geometries created by the draw interaction. |
createLinkInteraction ⇒ ol.interaction.Link
Return an interaction that synchronizes the map state with the URL.
Kind: global typedef
Param | Type | Default | Description |
---|---|---|---|
[options] | object | ol.interaction.Link options | |
[options.animate] | boolean | true | Animate view transitions. |
[params] | Array.<String> | [‘x’, ‘y’, ‘z’, ‘r’, ‘l’] | Properties to track. Default is to track x (center x), y (center y), z (zoom), r (rotation) and l (layers). |
[replace] | boolean | false | Replace the current URL without creating the new entry in browser history. By default, changes in the map state result in a new entry being added to the browser history. |
[prefix] | string | ””“ | By default, the URL will be updated with search parameters x, y, z, and r. To avoid collisions with existing search parameters that your application uses, you can supply a custom prefix for the ones used by this interaction (e.g. ‘ol:‘). |
createSnapInteraction ⇒ ol.interaction.Snap
Return an interaction that handles snapping of vector features while modifying or drawing them. The features can come from a ol.source.Vector or ol.Collection Any interaction object that allows the user to interact with the features using the mouse can benefit from the snapping, as long as it is added before.
The snap interaction modifies map browser event coordinate
and pixel
properties to force the snap to occur to any interaction that them.
Kind: global typedef
Param | Type | Default | Description |
---|---|---|---|
[options] | object | ol.interaction.Snap options | |
[features] | Array.<ol.Feature> | Snap to these features. Either this option or source should be provided. | |
[edge] | boolean | true | Snap to edges. |
[vertex] | boolean | true | Snap to vertices. |
[pixelTolerance] | number | 10 | Pixel tolerance for considering the pointer close enough to a segment or vertex for snapping. |
Example
const snap = gwsJS.edit.createSnapInteraction({ source });
gwsJS.getMap().addInteraction(snap);
createTranslateInteraction ⇒ ol.interaction.Translate
Interaction for translating (moving) features. If you want to translate multiple features in a single action
(for example, the collection used by a select interaction), construct the interaction with the features
option.
Kind: global typedef
Emits: event
Param | Type | Default | Description |
---|---|---|---|
[options] | object | ||
[condition] | function | A function that takes an module/MapBrowserEvent~MapBrowserEvent and returns a boolean to indicate whether that event should be handled. Default is module/events/condition.always. | |
[features] | Array.<ol.Feature> | Features contained in this collection will be able to be translated together. | |
[layers] | Array.<ol.layer.Layer> | FilterFunction | A list of layers from which features should be translated. Alternatively, a filter function can be provided. The function will be called for each layer in the map and should return true for layers that you want to be translatable. If the option is absent, all visible layers will be considered translatable. Not used if features is provided. | |
[filter] | FilterFunction | A function that takes an module/Feature~Feature and an module/layer/Layer~Layer and returns true if the feature may be translated or false otherwise. Not used if features is provided. | |
[hitTolerance] | number | 0 | Hit-detection tolerance. Pixels inside the radius around the given position will be checked for features. |
getControl ⇒ ol.control.Control
컨트롤 조회
Kind: global typedef
Returns: ol.control.Control
- 컨트롤
Param | Type | Description |
---|---|---|
name | ’modify’ | ‘draw-point’ | ‘draw-line’ | ‘draw-polygon’ | 컨트롤 이름 |
showControl : function
컨트롤 표시/숨김
Kind: global typedef
Param | Type | Description |
---|---|---|
name | ’modify’ | ‘draw-point’ | ‘draw-line’ | ‘draw-polygon’ | 컨트롤명 |
show | boolean | 표시여부 |
toJsts ⇒ Promise.<Array.<jsts.Geometry>>
OL 지오메트리를 JSTS 지오메트리로 변환
Kind: global typedef
Param | Type |
---|---|
geometries | ol.geom.Geometry | Array.<ol.geom.Geometry> |
fromJsts ⇒ Array.<ol.geom.Geometry>
JSTS 지오메트리를 OL 지오메트리로 변환
Kind: global typedef
Param | Type |
---|---|
geometries | jsts.Geometry | Array.<jsts.Geometry> |
splitJsts ⇒ Array.<jsts.Geometry>
지오메트리 분할
Kind: global typedef
Returns: Array.<jsts.Geometry>
- 지오메트리
Param | Type | Description |
---|---|---|
source | jsts.Geometry | Array.<jsts.Geometry> | 지오메트리 |
lookup | jsts.Geometry | Array.<jsts.Geometry> | 지오메트리 |
isPointOnSegment ⇒ boolean
좌표가 선분위에 있는지 판별
Kind: global typedef
Returns: boolean
- 선분위에 있으면 true
Param | Type |
---|---|
start | jsts.geom.Coordinate |
end | jsts.geom.Coordinate |
p | jsts.geom.Coordinate |
splitLineAtPoint ⇒ Array.<jsts.geom.LineString>
라인스트링을 포인트로 분할
Kind: global typedef
Returns: Array.<jsts.geom.LineString>
- 지오메트리
Param | Type | Description |
---|---|---|
line | jsts.geom.LineString | 지오메트리 |
point | jsts.geom.Point | 지오메트리 |
unionJsts ⇒ jsts.Geometry
지오메트리 합집합
Kind: global typedef
Returns: jsts.Geometry
- 지오메트리
Param | Type | Description |
---|---|---|
source | jsts.Geometry | Array.<jsts.Geometry> | 지오메트리 |
differenceJsts ⇒ Array.<jsts.Geometry>
지오메트리 차집합
Kind: global typedef
Returns: Array.<jsts.Geometry>
- 지오메트리
Param | Type | Description |
---|---|---|
source | jsts.Geometry | Array.<jsts.Geometry> | 지오메트리 |
lookup | jsts.Geometry | Array.<jsts.Geometry> | 지오메트리 |
mergeJsts ⇒ Array.<jsts.geom.Geometry>
지오메트리 병합
Kind: global typedef
Returns: Array.<jsts.geom.Geometry>
- 지오메트리
Param | Type | Description |
---|---|---|
source | jsts.geom.Geometry | Array.<jsts.geom.Geometry> | 지오메트리 |