컨텐츠로 이동

Edit

Typedefs

validateProcboolean

validate 프로시져

geometryProcol.geom.Geometry

geometry 프로시져

startPromise

편집 시작

endvoid

편집 종료

isActiveboolean

편집 활성화 여부

createCadLayerol.layer.Layer

캐드 편집 레이어 생성

createSelectionLayerol.layer.Layer

선택 레이어 생성

getLayerFeaturesPromise.<Array.<ol.Feature>>

레이어 피쳐 조회

getLayerFeaturesByIdPromise.<Array.<ol.Feature>>

레이어 피쳐 조회

addLayerFeaturesPromise.<number>

레이어 피쳐 추가

updateLayerFeaturesPromise.<number>

레이어 피쳐 수정

removeLayerFeaturesPromise.<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.

createDrawInteractionol.interaction.Draw

Interaction for drawing vector data. By default, this interaction allows drawing linestrings, polygons, and circles.

createLinkInteractionol.interaction.Link

Return an interaction that synchronizes the map state with the URL.

createSnapInteractionol.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.

createTranslateInteractionol.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.

getControlol.control.Control

컨트롤 조회

showControl : function

컨트롤 표시/숨김

toJstsPromise.<Array.<jsts.Geometry>>

OL 지오메트리를 JSTS 지오메트리로 변환

fromJstsArray.<ol.geom.Geometry>

JSTS 지오메트리를 OL 지오메트리로 변환

splitJstsArray.<jsts.Geometry>

지오메트리 분할

isPointOnSegmentboolean

좌표가 선분위에 있는지 판별

splitLineAtPointArray.<jsts.geom.LineString>

라인스트링을 포인트로 분할

unionJstsjsts.Geometry

지오메트리 합집합

differenceJstsArray.<jsts.Geometry>

지오메트리 차집합

mergeJstsArray.<jsts.geom.Geometry>

지오메트리 병합

validateProc ⇒ boolean

validate 프로시져

Kind: global typedef
Returns: boolean - true: 편집 허용, false: 편집 금지

ParamTypeDescription
coordinatesArray.<number>클릭 좌표
geometryol.geom.Geometry현재 지오메트리
projectionstring현재 좌표계

geometryProc ⇒ ol.geom.Geometry

geometry 프로시져

Kind: global typedef
Returns: ol.geom.Geometry - 생성된 지오메트리

ParamTypeDescription
coordinatesArray.<number>생성된 좌표
geometryol.geom.Geometry현재 지오메트리
projectionstring현재 좌표계

start ⇒ Promise

편집 시작

Kind: global typedef

ParamTypeDefaultDescription
optionsobject
options.showToolbarboolean툴바 표시 여부
options.onDrawClickvalidateProc그리기 클릭 핸들러
options.onDrawGeometrygeometryProc지오메트리 생성 핸들러
[options.map]ol.Map맵 객체 (기본값: this.getMap())
[options.target]HTMLElement툴바 렌더링 대상
options.editLayerol.layer.Vector편집 레이어
options.resultLayerol.layer.Vector결과 레이어
options.lookupLayerol.layer.Vector조회 레이어
options.selectionLayerol.layer.Vector선택 레이어

Example

await gwsJS.edit.start({  
  editLayer,
  resultLayer,
  lookupLayer,
  selectionLayer,
  showToolbar: true,
  target: div,
  onDrawClick,
  onDrawGeometry,
})
console.log(div.outerHTML.toString())

end ⇒ void

편집 종료

Kind: global typedef

isActive ⇒ boolean

편집 활성화 여부

Kind: global typedef
Returns: boolean - true: 편집중, false: 편집종료

createCadLayer ⇒ ol.layer.Layer

캐드 편집 레이어 생성

Kind: global typedef
Returns: ol.layer.Layer - 레이어

ParamTypeDescription
featuresArray.<ol.Feature>피쳐
optionsobject
[options.title]string레이어 라벨

createSelectionLayer ⇒ ol.layer.Layer

선택 레이어 생성

Kind: global typedef
Returns: ol.layer.Layer - 레이어

ParamTypeDescription
featuresArray.<ol.Feature>피쳐
optionsobject
[options.title]string레이어 라벨

getLayerFeatures ⇒ Promise.<Array.<ol.Feature>>

레이어 피쳐 조회

Kind: global typedef
Returns: Promise.<Array.<ol.Feature>> - 피쳐

ParamTypeDescription
gdxNamestringGDX명
layerNamestring레이어명
[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>> - 피쳐

ParamTypeDescription
gdxNamestringGDX명
layerNamestring레이어명
idsString | 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> - 결과 카운트

ParamTypeDescription
gdxNamestringGDX명
layerNamestring레이어명
featuresArray.<ol.Feature>피쳐
[srsName]string피쳐 좌표계 [기본값: 현재 지도 좌표계]
[options]object
[options.idgen]‘UseExisting’ | nullID 생성기 [자동: ‘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> - 결과 카운트

ParamTypeDescription
gdxNamestringGDX명
layerNamestring레이어명
featuresArray.<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> - 결과 카운트

ParamTypeDescription
gdxNamestringGDX명
layerNamestring레이어명
featuresArray.<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

ParamTypeDefaultDescription
optionsobjectol.interaction.Select options
[options.addCondition]functionA 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]functionA 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.Stylenullundefined
[options.removeCondition]functionA 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]functionA 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]booleanfalseA 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.FilterFunctionA 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]number0Hit-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

ParamTypeDefaultDescription
[options]objectol.interaction.Draw options
GeometryTypetype of the geometries being drawn with this instance.
[clickTolerance]number6The 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.VectorDestination source for the drawn features.
[dragVertexDelay]number500Delay in milliseconds after pointerdown before the current vertex can be dragged to its exact position.
[snapTolerance]number12Pixel distance for snapping to the drawing finish. Must be greater than 0.
[stopClick]booleantrueStop click and singleclick, and doubleclick events from firing during drawing.
[maxPoints]numberThe number of points that can be draw before a polygon ring or line string is finished. By default there is no restriction.
[minPoints]numberThe 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]booleanA 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 | FlatStyleLikeStyle 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]GeometryFunctionFunction that is called when a new coordinates are updated.
[geometryName]stringGeometry name to use for features created by the draw interaction.
[condition]functionA 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]booleanfalseOperate 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]functionCondition 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]booleanfalseTrace a portion of another geometry. Ignored when in freehand mode.
[traceSource]ol.source.VectorSource 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]booleanfalseWrap the world horizontally on the sketch overlay.
[geometryLayout]GeometryLayout’XY’Layout of the feature geometries created by the draw interaction.

Return an interaction that synchronizes the map state with the URL.

Kind: global typedef

ParamTypeDefaultDescription
[options]objectol.interaction.Link options
[options.animate]booleantrueAnimate 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]booleanfalseReplace 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

ParamTypeDefaultDescription
[options]objectol.interaction.Snap options
[features]Array.<ol.Feature>Snap to these features. Either this option or source should be provided.
[edge]booleantrueSnap to edges.
[vertex]booleantrueSnap to vertices.
[pixelTolerance]number10Pixel 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

ParamTypeDefaultDescription
[options]object
[condition]functionA 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> | FilterFunctionA 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]FilterFunctionA 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]number0Hit-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 - 컨트롤

ParamTypeDescription
name’modify’ | ‘draw-point’ | ‘draw-line’ | ‘draw-polygon’컨트롤 이름

showControl : function

컨트롤 표시/숨김

Kind: global typedef

ParamTypeDescription
name’modify’ | ‘draw-point’ | ‘draw-line’ | ‘draw-polygon’컨트롤명
showboolean표시여부

toJsts ⇒ Promise.<Array.<jsts.Geometry>>

OL 지오메트리를 JSTS 지오메트리로 변환

Kind: global typedef

ParamType
geometriesol.geom.Geometry | Array.<ol.geom.Geometry>

fromJsts ⇒ Array.<ol.geom.Geometry>

JSTS 지오메트리를 OL 지오메트리로 변환

Kind: global typedef

ParamType
geometriesjsts.Geometry | Array.<jsts.Geometry>

splitJsts ⇒ Array.<jsts.Geometry>

지오메트리 분할

Kind: global typedef
Returns: Array.<jsts.Geometry> - 지오메트리

ParamTypeDescription
sourcejsts.Geometry | Array.<jsts.Geometry>지오메트리
lookupjsts.Geometry | Array.<jsts.Geometry>지오메트리

isPointOnSegment ⇒ boolean

좌표가 선분위에 있는지 판별

Kind: global typedef
Returns: boolean - 선분위에 있으면 true

ParamType
startjsts.geom.Coordinate
endjsts.geom.Coordinate
pjsts.geom.Coordinate

splitLineAtPoint ⇒ Array.<jsts.geom.LineString>

라인스트링을 포인트로 분할

Kind: global typedef
Returns: Array.<jsts.geom.LineString> - 지오메트리

ParamTypeDescription
linejsts.geom.LineString지오메트리
pointjsts.geom.Point지오메트리

unionJsts ⇒ jsts.Geometry

지오메트리 합집합

Kind: global typedef
Returns: jsts.Geometry - 지오메트리

ParamTypeDescription
sourcejsts.Geometry | Array.<jsts.Geometry>지오메트리

differenceJsts ⇒ Array.<jsts.Geometry>

지오메트리 차집합

Kind: global typedef
Returns: Array.<jsts.Geometry> - 지오메트리

ParamTypeDescription
sourcejsts.Geometry | Array.<jsts.Geometry>지오메트리
lookupjsts.Geometry | Array.<jsts.Geometry>지오메트리

mergeJsts ⇒ Array.<jsts.geom.Geometry>

지오메트리 병합

Kind: global typedef
Returns: Array.<jsts.geom.Geometry> - 지오메트리

ParamTypeDescription
sourcejsts.geom.Geometry | Array.<jsts.geom.Geometry>지오메트리