DrawingManager class
The drawing manager is the primary class that manages all the drawing functionality on the map. It can be used directly (programmatically or with custom toolbars) or in combination with the drawing toolbar control.
- Extends
-
EventEmitter<DrawingManagerEvents>
Constructors
Drawing |
Constructs a DrawingManager. |
Methods
dispose() | Disposes the DrawingManager. When disposed, all resources used by the DrawingManager are released. Any attached toolbars or dialogs will also be disposed. |
edit(azmaps. |
Edits a shape. If the shape is not already in the data source, it adds it to it. |
get |
Gets the collection of layers used for rendering the shapes draw on the map. Edit these layers' options to customize the rendering. |
get |
Gets the options used by the DrawingManager. |
get |
Gets the collection of preview layers used for rendering the shapes draw on the map. Edit these layers' options to customize the rendering. |
get |
Gets the data source used by the DrawingManager to store the completed shapes. |
set |
Sets the options for the DrawingManager. |
Constructor Details
DrawingManager(azmaps.Map, DrawingManagerOptions)
Constructs a DrawingManager.
new DrawingManager(map: azmaps.Map, options?: DrawingManagerOptions)
Parameters
- map
- azmaps.Map
The map to draw on.
- options
- DrawingManagerOptions
The options for the DrawingManager.
Method Details
dispose()
Disposes the DrawingManager. When disposed, all resources used by the DrawingManager are released. Any attached toolbars or dialogs will also be disposed.
function dispose()
edit(azmaps.Shape)
Edits a shape. If the shape is not already in the data source, it adds it to it.
function edit(shape: azmaps.Shape)
Parameters
- shape
- azmaps.Shape
The shape to put in edit mode.
getLayers()
Gets the collection of layers used for rendering the shapes draw on the map. Edit these layers' options to customize the rendering.
function getLayers(): DrawingLayers
Returns
getOptions()
Gets the options used by the DrawingManager.
function getOptions(): DrawingManagerOptions
Returns
getPreviewLayers()
Gets the collection of preview layers used for rendering the shapes draw on the map. Edit these layers' options to customize the rendering.
function getPreviewLayers(): DrawingLayers
Returns
getSource()
Gets the data source used by the DrawingManager to store the completed shapes.
function getSource(): azmaps.source.DataSource
Returns
setOptions(DrawingManagerOptions)
Sets the options for the DrawingManager.
function setOptions(options: DrawingManagerOptions)
Parameters
- options
- DrawingManagerOptions
The new options for the DrawingManager.