new polylineTool
Google maps drawing polyline tool class. Provides methods to draw over the ajs.maps.gmapdraw.map instance
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
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 | ||||||||||
options |
Object | A class options object
Properties
|
- Source:
- gmapdraw.js, line 1152
Extends
Methods
-
activate
Activates the tool
-
- Source:
- gmapdraw.js, line 866
Returns:
void -
addItem
Adds an item to the items
-
Parameters:
Name Type Description item
Object a google map shape - Source:
- gmapdraw.js, line 940
Returns:
void -
clear
Clears all drawed points
-
- Source:
- gmapdraw.js, line 1266
Returns:
void -
clickHandler
Handles the click event over the map when the tool is the drawing one
-
- Source:
- gmapdraw.js, line 1193
Returns:
void -
deactivate
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:
- gmapdraw.js, line 886
Returns:
void -
exportData
Returns all the drawed points data
-
- Source:
- gmapdraw.js, line 1285
Returns:
data An array of arrays of objects representing the polylines' points coordinates- Type
- Array
Example
// two polylines, the first with 2 points, the second with 3 points. [[{lat: 45, lng:7}, {lat:46, lng:7}], [{lat: 42, lng: 11}, {lat: 41, lng: 10.8}, {lat: 44, lng: 8}]]
-
getToolName
Returns the tool name
-
- Source:
- gmapdraw.js, line 966
Returns:
The tool name- Type
- String
-
importData
Imports the data as polylines
-
Parameters:
Name Type Description data
Array An array of arrays of objects representing the polylines' points coordinates - Source:
- gmapdraw.js, line 1308
Example
// two polylines, the first with 2 points, the second with 3 points. [[{lat: 45, lng:7}, {lat:46, lng:7}], [{lat: 42, lng: 11}, {lat: 41, lng: 10.8}, {lat: 44, lng: 8}]]
-
<protected> options
Returns the class options
-
- Source:
- gmapdraw.js, line 816
Returns:
The class options object- Type
- Object
-
prepareTool
Prepares the tool
-
- Source:
- gmapdraw.js, line 1184
Returns:
void -
prepareTool
Prepares the current drawing tool
-
- Source:
- gmapdraw.js, line 931
Returns:
void -
<protected> protectedProp
Returns the class protected properties
-
- Source:
- gmapdraw.js, line 826
Returns:
The class protected properties object- Type
- Object
-
<protected> removeController
Removes the default tool controller
-
- Source:
- gmapdraw.js, line 857
Returns:
void -
<protected> setController
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:
- gmapdraw.js, line 837
Returns:
void -
setDrawing
Sets the current drawing tool
-
- Source:
- gmapdraw.js, line 921
Returns:
void -
setMaxItemsAllowed
Sets the maximum number of items that the tool may draw
-
Parameters:
Name Type Description max
The maximum number of drawable items - Source:
- gmapdraw.js, line 949
Returns:
void -
setNextShape
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:
- gmapdraw.js, line 958
Returns:
void -
tipsText
Returns the tool help tip text
-
- Source:
- gmapdraw.js, line 1176
Returns:
The tips text- Type
- String
-
updateInfo
Displays information about rawed points in the console
-
- Source:
- gmapdraw.js, line 1246
Returns:
void