new RectangleTool(map)
Parameters:
Name | Type | Description |
---|---|---|
map |
OM.Map | the map instance to be associated with. |
Returns:
An instance of OM.tool.RectangleTool
Extends
Methods
-
clear()
-
Clears the tool's generated shapes and restores its state to pre-start.
-
getDraggingHeight()
-
Gets the current rectangle height in map units.
Returns:
the rectangle height when dragging (0 if not in dragging mode).
- Type
- float
-
getDraggingWidth()
-
Gets the current rectangle width in map units.
Returns:
the rectangle width when dragging (0 if not in dragging mode).
- Type
- float
-
getGeometry()
-
Get the generated geometry. This should typically be called from
inside an event listener that is registered to the tool's life cycle
event such as OM.event.ToolEvent.TOOL_END.- Inherited From:
Returns:
the geometry created by the tool
- Type
- OM.geometry.Geometry
-
getStatus()
-
Get the tool's status. Can be one of OM.tool.Tool.STARTED, OM.tool.Tool.STOPPED, or OM.tool.Tool.FINISHED
- Inherited From:
Returns:
tool status
- Type
- int
-
on()
-
A shorthand name for the member function addListener.
- Inherited From:
- Mixes In:
-
setDrawingStyle(style)
-
Set the line drawing style
Parameters:
Name Type Description style
OM.style.Line A line style used to
display the shape boundary as the user is drawing it.- Inherited From:
Returns:
The tool instance
- Type
- OM.tool.Tool
-
setStyle(style)
-
Set rendering style for the completed feature
Parameters:
Name Type Description style
OM.Style The style to be used for the completed shape
- Inherited From:
Returns:
The tool instance
- Type
- OM.tool.Tool
-
setZeroSizeAllowed(flag)
-
Sets whether this tool allows creation of zero-sized rectangles.
Default is disabled with a warning dialog shown to user.Parameters:
Name Type Description flag
boolean if true then zero-sized rectangles are allowed;
false otherwise. -
start()
-
This is the start method. It's an entrance to draw a tool
Returns:
The tool itself