Class MVRedlineTool
MVRedlineTool defines a redline tool instance with which the user can draw a polyline by clicking and moving the mouse on the map repeatedly. After the redline tool instance is activated, a new redline shape point is created and the redline polyline is extended whenever the user clicks the mouse on the map.
After all shape points have been created, the application can invoke function MVRedlineTool.MVRedlineTool to render a polygon feature constructed with all redline shape points on the map.
Once created, the redline feature (polyline or polygon) stays on the map until the application invokes function MVRedlineTool.clear to remove the redline feature from the map.
Constructor Attributes | Constructor Name and Description |
---|---|
MVRedlineTool(lineStyle, areaStyle, foiServerURL)
|
Method Attributes | Method Name and Description |
---|---|
addVertex(vIdx, xOrdinate, yOrdinate)
This method adds a new shape point.
|
|
attachEventListener(event, listener)
This method attaches an event listener to handle one of the following redline tool events:
MVEvent.NEW_SHAPE_POINT, MVEvent.FINISH, MVEvent.CLEAR and MVEvent.MODIFY.
|
|
clear()
This method clears any lines or polygon rendered by the current MVRedlineTool instance.
|
|
detachEventListener(event, listener)
This method detaches an event listener that has previously attached to the redline tool
by #attachEventListener.
|
|
generate()
This method generates the redline FOI.
|
|
This method gets the current redline editing mode.
|
|
getFOI()
This method returns the FOI after the user finishes clicking mouse to generate
shape points and invokes function MVRedlineTool.generate to render an FOI on the map.
|
|
This method gets the redline line segments as an FOI array.
|
|
This method returns the array of ordinates of the redline geometry.
|
|
This method gets the redline shape points as an FOI array.
|
|
This method gets the number of redline shape points.
|
|
This method returns the MVSdoGeometry object that represents the redline
area on the map.
|
|
This method returns the polygon area FOI after the user finishes clicking mouse to generate
polygon shape points and invokes function MVRedlineTool.generate to render a polygon feature on the map.
|
|
This method returns the MVSdoGeometry object that represents the redline
FOI on the map.
|
|
This method gets the status of the redline tool.
|
|
init(gtypeArg)
This method initializes the redline tool instance.
|
|
moveVertex(vertex, xOrdinate, yOrdinate)
This method moves the specified shape point.
|
|
removeEdge(edge, removeFlag)
This method removes the specified shape line.
|
|
removeVertex(vertex)
This method removes the specified shape point.
|
|
setAutoClose(enable(true))
This method sets whether to automatically close the redline and finish redline drawing
when the user clicks at the location where the first redline point is located.
|
|
setControlPanelVisible(visible)
This method sets the visibility of the control panel.
|
|
setEditingMode(mode)
This method sets the redline editing mode.
|
|
setEventListener(event, listener)
This method is deprecated.
|
|
setFillArea(enabled)
This method sets whether to fill the redline area when the user is drawing
the redline geometry.
|
|
This method sets whether to display the redline polygon on top of the map.
|
|
setMarkerImage(imagesrc, imagewidth, imageheight)
This method customizes the marker image used to draw the redline shape
points.
|
|
setRenderingStyle(objType, objStyle)
This method sets the style for redline shape points, lines or polygon areas.
|
|
setTextStyle(style)
This method set the distance tool's distance info box div style.
|
- Parameters:
- {String} lineStyle
- A string that specifies the style used to render the polyline that connects the redline shape points. The line style is defined in the USER_SDO_STYLES view. The style is specified in the form "data-source-name"."style-name", where "style-name" is the name of the style and "data-source-name" is the name of the data source in which the style is defined.
- {String} areaStyle
- A string that specifies the style used to render the redline polygon. The area style is defined in the USER_SDO_STYLES view. The style is specified in the form "data-source-name"."style-name", where "style-name" is the name of the style and "data-source-name" is the name of the data source in which the style is defined.
- {String} foiServerURL
- An optional String parameter that specifies the URL of the FOI server that renders the redline features(line and polygon). The FOI server URL should be in the form http://host:port/mapviewer/foi. If omitted, the URL of the FOI server is derived from the MapViewer base URL.
- Returns:
- The newly created MVRedlineTool object.
- Parameters:
- {integer} vIdx
- An integer greater than 0 that specifies the index at which the new shape point should be inserted. The index of the first shape point is 0.
- {double} xOrdinate
- It indicates horizontal ordinate of the new shape point.
- {double} yOrdinate
- It indicates vertical ordinate of the new shape point.
- Returns:
- none
- A MVEvent.NEW_SHAPE_POINT event is fired when the user creates a new redline shape point by clicking the mouse on the map. No parameter is passed to this function when it is invoked.
- A MVEvent.FINISH event is fired when the redline drawing is finished.
- A MVEvent.MODIFY event is fired when any of the existing redline shape points or lines is moved.
- A MVEvent.CLEAR event is fired when the redline drawing is cleared.
- Parameters:
- {String} event
- a String that specifies the type of event to be handled by the listener. It can only be MVEvent.NEW_SHAPE_POINT, MVEvent.FINISH or MVEvent.MODIFY.
- {Function} listener
- a javascript listener function. There is no parameter passed to the listener when it is called.
- Returns:
- none
- Returns:
- none
- Parameters:
- {String} event
- a String that specifies the type of event to be handled by the listener. It can only be MVEvent.NEW_SHAPE_POINT, MVEvent.FINISH, MVEvent.MODIFY or MVEvent.CLEAR.
- {Function} listener
- a javascript listener function. There is no parameter passed to the listener when it is called.
- Returns:
- none
- Returns:
- none
The result is a object that specifies whether each of the following editing operations is enabled, point deletion, point dragging, line deletion and line dragging. It has the following attributes:
- deletePoint: true if point deletion is enabled, false otherwise.
- dragPoint: true if point dragging is enabled, false otherwise.
- deleteLine: true if line deletion is enabled, false otherwise.
- dragLine: true if line dragging is enabled, false otherwise.
- Returns:
- the editing mode.
- Returns:
- the MVFOI object that represents the generated FOI.
- Requires:
- MVFOI
- See:
- MVFOI
- Returns:
- the line FOI array.
- Returns:
- the array of ordinates for the redline geometry.
- Returns:
- the point FOI array.
- Returns:
- the number of shape points.
- Returns:
- MVSdoGeometry object representing the redline area on the map.
- Requires:
- MVSdoGeometry
- See:
- MVSdoGeometry
- Returns:
- the MVFOI object that represents the polygon area FOI.
- Requires:
- MVFOI
- See:
- MVFOI
- Returns:
- MVSdoGeometry object representing the redline area on the map.
- Requires:
- MVSdoGeometry
- See:
- MVSdoGeometry
- 0: Not ready
- 1: Ready and initialized
- 2: Redlining finished and polygon area image generated
- Returns:
- the status of the redline tool.
- Parameters:
- {int} gtypeArg
- an integer which is consistent with gtype value of MVSdoGeometry object, that is, 1 for point, 2 for line and 3 for polygon. Default value is 3 for backward compatibility.
- Returns:
- none
- Parameters:
- {Object} vertex
- An integer or FOI object that specifies a shape point to be moved. If it is an integer, it should specify the index of shape point. The index of the first shape point is 0.
- {double} xOrdinate
- It indicates new horizontal ordinate of the specified shape point.
- {double} yOrdinate
- It indicates new vertical ordinate of the specified shape point.
- Returns:
- none
- Parameters:
- {Object} edge
- An integer or FOI object that specifies a shape line to be removed. If it is an integer, it should specify the index of the shape line. The index of the first shape line is 0.
- {String} removeFlag
- It specifies which vertex of the specified shape line will be removed. Its value can only be "left" or "right", and default value is "right".
- Returns:
- none
- Parameters:
- {Object} vertex
- An integer or FOI object that specifies the shape point to be removed. If it is an integer, it should specify the index of shape point. The index of the first shape point is 0.
- Returns:
- none
- Parameters:
- {Boolean} enable(true)
- or disable(false) automatic closing.
- Parameters:
- {Boolean} visible
- true if visible and false if invisible.
- Returns:
- none
The parameter mode is a object that specifies whether to enable or disable any of the above editing operations. The object has the following attributes:
- deletePoint: true if point deletion is enabled, false otherwise.
- dragPoint: true if point dragging is enabled, false otherwise.
- deleteLine: true if line deletion is enabled, false otherwise.
- dragLine: true if line dragging is enabled, false otherwise.
For example, {deletePoint:true, dragPoint:false, deleteLine:true, dragLine:false} enables point deletion and line deletion, while disabling point dragging and line dragging. Null mode value disables all editing operations.
- Parameters:
- {Object} mode
- the object that specifies whether to enable or disable each of the editing operations.
- Returns:
- none.
- Parameters:
- event
- listener
- Parameters:
- {Boolean} enabled
- fill (true) or not fill(false) the redline area.
- Parameters:
- {Boolean} to
- place redline polygon on top(true) or not(false).
- Parameters:
- {String} imagesrc
- it specifies the URL of marker image file.
- {int} imagewidth
- it specifies the width of marker image.
- {int} imageheight
- it specifies the height of marker image.
- Returns:
- none
- Parameters:
- {String} objType
- It specifies the object for which a style is applied to. Its value can only be MVRedlineTool.STYLE_POINT, MVRedlineTool.STYLE_LINE or MVRedlineTool.STYLE_AREA.
- {Object} objStyle
- A string or style object which specifies the rendering style.
If it is a string, the string should be in the form of
. , where is the name of the style which is defined in the USER_SDO_STYLES view, and is the name of the data source in which the style is defined. If it is a style object, it should be of type MVStyleMarker, MVStyleColor and MVXMLStyle etc.
- Returns:
- none
- Parameters:
- {String} style
- CCS style format
- Returns:
- none