new circleTool(map, ctrl, options)
Google maps drawing circle 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:
 - src/maps/gmapdraw.js, line 1548
 
Extends
Methods
- 
    
activate()
Activates the tool
 - 
    
    
    
    
    
    
    
    
    
- Inherited From:
 - Source:
 - src/maps/gmapdraw.js, line 872
 
Returns:
void - 
    
addItem(item)
Adds an item to the items
 - 
    
    
    
    
    
    
    
        
Parameters:
Name Type Description itemObject a google map shape - Inherited From:
 - Source:
 - src/maps/gmapdraw.js, line 946
 
Returns:
void - 
    
clear()
Clears all drawed points
 - 
    
    
    
    
    
    
    
    
    
- Source:
 - src/maps/gmapdraw.js, line 1672
 
Returns:
void - 
    
clickHandler()
Handles the click event over the map when the tool is the drawing one
 - 
    
    
    
    
    
    
    
    
    
- Source:
 - src/maps/gmapdraw.js, line 1591
 
Returns:
void - 
    
deactivate(remove_ctrl)
Removes the tool
 - 
    
    
    
    
    
    
    
        
Parameters:
Name Type Argument Default Description remove_ctrlBoolean <optional> 
false Whether or not to remove the tool control if the default one - Inherited From:
 - Source:
 - src/maps/gmapdraw.js, line 892
 
Returns:
void - 
    
distance(point1, point2) → {Number}
Returns the distance between 2 google.maps.LatLng points
 - 
    
    
    
    
    
    
    
        
Parameters:
Name Type Description point1google.maps.LatLng The first point point2google.maps.LatLng The second point - Source:
 - src/maps/gmapdraw.js, line 1690
 
Returns:
The distance in meters- Type
 - Number
 
 - 
    
exportData() → {Array}
Returns all the drawed points data
 - 
    
    
    
    
    
    
    
    
    
- Source:
 - src/maps/gmapdraw.js, line 1709
 
Returns:
data An array objects representing the circle's properties- Type
 - Array
 
Example
[{lat: 45, lng: 7, radius: 40000}, {lat: 35, lng: 15, radius: 650000}] - 
    
getToolName() → {String}
Returns the tool name
 - 
    
    
    
    
    
    
    
    
    
- Inherited From:
 - Source:
 - src/maps/gmapdraw.js, line 972
 
Returns:
The tool name- Type
 - String
 
 - 
    
importData(data)
Imports all data as circles
 - 
    
    
    
    
    
    
    
        
Parameters:
Name Type Description dataArray An array objects representing the circle's properties - Source:
 - src/maps/gmapdraw.js, line 1728
 
Example
[{lat: 45, lng: 7, radius: 40000}, {lat: 35, lng: 15, radius: 650000}] - 
    
<protected> options() → {Object}
Returns the class options
 - 
    
    
    
    
    
    
    
    
    
- Inherited From:
 - Source:
 - src/maps/gmapdraw.js, line 822
 
Returns:
The class options object- Type
 - Object
 
 - 
    
prepareTool()
Prepares the tool
 - 
    
    
    
    
    
    
    
    
    
- Source:
 - src/maps/gmapdraw.js, line 1582
 
Returns:
void - 
    
<protected> protectedProp() → {Object}
Returns the class protected properties
 - 
    
    
    
    
    
    
    
    
    
- Inherited From:
 - Source:
 - src/maps/gmapdraw.js, line 832
 
Returns:
The class protected properties object- Type
 - Object
 
 - 
    
<protected> removeController()
Removes the default tool controller
 - 
    
    
    
    
    
    
    
    
    
- Inherited From:
 - Source:
 - src/maps/gmapdraw.js, line 863
 
Returns:
void - 
    
<protected> setController(ctrl)
Sets the tool controller
 - 
    
    
    
    
    
    
    
        
Parameters:
Name Type Argument Default Description ctrlString/Element <optional> 
null The id attribute or the element itself which serves as the tool controller, if nullthe default controller is used.- Inherited From:
 - Source:
 - src/maps/gmapdraw.js, line 843
 
Returns:
void - 
    
setDrawing()
Sets the current drawing tool
 - 
    
    
    
    
    
    
    
    
    
- Inherited From:
 - 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 maxThe maximum number of drawable items - Inherited From:
 - 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_shapeWhether or not next click has to start a new shape - Inherited From:
 - Source:
 - src/maps/gmapdraw.js, line 964
 
Returns:
void - 
    
tipsText() → {String}
Returns the tool help tip text
 - 
    
    
    
    
    
    
    
    
    
- Source:
 - src/maps/gmapdraw.js, line 1574
 
Returns:
The tips text- Type
 - String
 
 - 
    
updateInfo()
Displays information about rawed points in the console
 - 
    
    
    
    
    
    
    
    
    
- Source:
 - src/maps/gmapdraw.js, line 1652
 
Returns:
void