new tool(id, map, ctrl, tool_name)
Google maps drawing tool class.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The identifier of the child class |
map |
ajs.maps.gmapdraw.map | The gmapdraw map instance which handles the tool |
ctrl |
String | Element | The id attribute or the element itself which controls the tool when clicking over it |
tool_name |
String | The drawing tool name |
- Source:
- src/maps/gmapdraw.js, line 786
Methods
-
activate()
Activates the tool
-
- Source:
- src/maps/gmapdraw.js, line 872
Returns:
void -
addItem(item)
Adds an item to the items
-
Parameters:
Name Type Description item
Object a google map shape - Source:
- src/maps/gmapdraw.js, line 946
Returns:
void -
deactivate(remove_ctrl)
Removes the tool
-
Parameters:
Name Type Argument Default Description remove_ctrl
Boolean <optional>
false Whether or not to remove the tool control if the default one - Source:
- src/maps/gmapdraw.js, line 892
Returns:
void -
getToolName() → {String}
Returns the tool name
-
- Source:
- src/maps/gmapdraw.js, line 972
Returns:
The tool name- Type
- String
-
<protected> options() → {Object}
Returns the class options
-
- Source:
- src/maps/gmapdraw.js, line 822
Returns:
The class options object- Type
- Object
-
prepareTool()
Prepares the current drawing tool
-
- Source:
- src/maps/gmapdraw.js, line 937
Returns:
void -
<protected> protectedProp() → {Object}
Returns the class protected properties
-
- Source:
- src/maps/gmapdraw.js, line 832
Returns:
The class protected properties object- Type
- Object
-
<protected> removeController()
Removes the default tool controller
-
- Source:
- src/maps/gmapdraw.js, line 863
Returns:
void -
<protected> setController(ctrl)
Sets the tool controller
-
Parameters:
Name Type Argument Default Description ctrl
String/Element <optional>
null The id attribute or the element itself which serves as the tool controller, if null
the default controller is used.- Source:
- src/maps/gmapdraw.js, line 843
Returns:
void -
setDrawing()
Sets the current drawing tool
-
- Source:
- src/maps/gmapdraw.js, line 927
Returns:
void -
setMaxItemsAllowed(max)
Sets the maximum number of items that the tool may draw
-
Parameters:
Name Type Description max
The maximum number of drawable items - Source:
- src/maps/gmapdraw.js, line 955
Returns:
void -
setNextShape(next_shape)
Sets the value of the next shape property (a new click starts a new shape if true)
-
Parameters:
Name Type Description next_shape
Whether or not next click has to start a new shape - Source:
- src/maps/gmapdraw.js, line 964
Returns:
void