Skip to content

Latest commit

 

History

History
146 lines (74 loc) · 3.87 KB

DrawingManager.md

File metadata and controls

146 lines (74 loc) · 3.87 KB

See html formatted version

DrawingManager class

google.maps.drawing.DrawingManager class

Allows users to draw markers, polygons, polylines, rectangles, and circles on the map. The DrawingManager's drawing mode defines the type of overlay that will be created by the user. Adds a control to the map, allowing the user to switch drawing mode.

This class extends MVCObject.

Library

drawing

Constructor

undefined

DrawingManager([options])

Parameters: 

Creates a DrawingManager that allows users to draw overlays on the map, and switch between the type of overlay to be drawn with a drawing control.

Methods

undefined

getDrawingMode()

Parameters:  None

Return Value:  OverlayType optional

Returns the DrawingManager's drawing mode.

undefined

getMap()

Parameters:  None

Return Value:  Map

Returns the Map to which the DrawingManager is attached, which is the Map on which the overlays created will be placed.

undefined

setDrawingMode(drawingMode)

Parameters: 

Return Value:  None

Changes the DrawingManager's drawing mode, which defines the type of overlay to be added on the map. Accepted values are 'marker', 'polygon', 'polyline', 'rectangle', 'circle', or null. A drawing mode of null means that the user can interact with the map as normal, and clicks do not draw anything.

undefined

setMap(map)

Parameters: 

Return Value:  None

Attaches the DrawingManager object to the specified Map.

undefined

setOptions(options)

Parameters: 

Return Value:  None

Sets the DrawingManager's options.

Events

undefined

function(circle)

Arguments: 

This event is fired when the user has finished drawing a circle.

undefined

function(marker)

Arguments: 

This event is fired when the user has finished drawing a marker.

undefined

function(event)

Arguments: 

This event is fired when the user has finished drawing an overlay of any type.

undefined

function(polygon)

Arguments: 

This event is fired when the user has finished drawing a polygon.

undefined

function(polyline)

Arguments: 

This event is fired when the user has finished drawing a polyline.

undefined

function(rectangle)

Arguments: 

This event is fired when the user has finished drawing a rectangle.