You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-maps/set-drawing-options.md
+28-19Lines changed: 28 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Drawing tools module
3
3
titleSuffix: Microsoft Azure Maps
4
-
description: In this article, you'll learn how to set drawing options data using the Microsoft Azure Maps Web SDK
4
+
description: This article describes how to set drawing options data using the Microsoft Azure Maps Web SDK
5
5
author: dubiety
6
6
ms.author: yuchungchen
7
7
ms.date: 06/15/2023
@@ -11,20 +11,20 @@ ms.service: azure-maps
11
11
12
12
# Use the drawing tools module
13
13
14
-
The Azure Maps Web SDK provides a [drawing tools module]. This module makes it easy to draw and edit shapes on the map using an input device such as a mouse or touch screen. The core class of this module is the [drawing manager](/javascript/api/azure-maps-drawing-tools/atlas.drawing.drawingmanager#setoptions-drawingmanageroptions-). The drawing manager provides all the capabilities needed to draw and edit shapes on the map. It can be used directly, and it's integrated with a custom toolbar UI. You can also use the built-in [drawing toolbar](/javascript/api/azure-maps-drawing-tools/atlas.control.drawingtoolbar) class.
14
+
The Azure Maps Web SDK provides a [drawing tools module]. This module makes it easy to draw and edit shapes on the map using an input device such as a mouse or touch screen. The core class of this module is the [drawing manager]. The drawing manager provides all the capabilities needed to draw and edit shapes on the map. It can be used directly, and it's integrated with a custom toolbar UI. You can also use the built-in [drawing toolbar] class.
15
15
16
16
## Loading the drawing tools module in a webpage
17
17
18
-
1. Create a new HTML file and [implement the map as usual](./how-to-use-map-control.md).
18
+
1. Create a new HTML file and [implement the map as usual].
19
19
2. Load the Azure Maps drawing tools module. You can load it in one of two ways:
20
-
- Use the globally hosted, Azure Content Delivery Network version of the Azure Maps services module. Add reference to the JavaScript and CSS Style Sheet in the `<head>` element of the file:
20
+
- Use the globally hosted, Azure Content Delivery Network version of the Azure Maps services module. Add reference to the JavaScript and CSS in the `<head>` element of the file:
- Or, you can load the drawing tools module for the Azure Maps Web SDK source code locally by using the [azure-maps-drawing-tools](https://www.npmjs.com/package/azure-maps-drawing-tools) npm package, and then host it with your app. This package also includes TypeScript definitions. Use this command:
27
+
- Or, you can load the drawing tools module for the Azure Maps Web SDK source code locally by using the [azure-maps-drawing-tools] npm package, and then host it with your app. This package also includes TypeScript definitions. Use this command:
28
28
29
29
`npm install azure-maps-drawing-tools`
30
30
@@ -34,7 +34,7 @@ The Azure Maps Web SDK provides a [drawing tools module]. This module makes it e
34
34
import * as drawing from "azure-maps-drawing-tools";
35
35
```
36
36
37
-
You would also need to embed the CSS Style Sheet for various controls to display correctly. If you're using a JavaScript bundler to bundle the dependencies and package your code, refer to your bundler's documentation on how it's done. For [Webpack], it's commonly done via a combination of `style-loader` and `css-loader` with documentation available at [style-loader].
37
+
You would also need to embed the CSS for various controls to display correctly. If you're using a JavaScript bundler to bundle the dependencies and package your code, refer to your bundler's documentation on how it's done. For [Webpack], it's commonly done via a combination of `style-loader` and `css-loader` with documentation available at [style-loader].
38
38
39
39
To begin, install style-loader and css-loader:
40
40
@@ -67,7 +67,7 @@ The Azure Maps Web SDK provides a [drawing tools module]. This module makes it e
67
67
68
68
## Use the drawing manager directly
69
69
70
-
Once the drawing tools module is loaded in your application, you can enable drawing and editing capabilities using the [drawing manager](/javascript/api/azure-maps-drawing-tools/atlas.drawing.drawingmanager#setoptions-drawingmanageroptions-). You can specify options for the drawing manager while instantiating it or alternatively use the `drawingManager.setOptions()` function.
70
+
Once the drawing tools module is loaded in your application, you can enable drawing and editing capabilities using the [drawing manager]. You can specify options for the drawing manager while instantiating it or alternatively use the `drawingManager.setOptions()` function.
71
71
72
72
### Set the drawing mode
73
73
@@ -95,7 +95,7 @@ The following image is an example of drawing mode of the `DrawingManager`. Selec
95
95
The drawing manager supports three different ways of interacting with the map to draw shapes.
96
96
97
97
-`click` - Coordinates are added when the mouse or touch is clicked.
98
-
-`freehand` - Coordinates are added when the mouse or touch is dragged on the map.
98
+
-`freehand` - Coordinates are added when the mouse or touch is dragged on the map.
99
99
-`hybrid` - Coordinates are added when the mouse or touch is clicked or dragged.
100
100
101
101
The following code enables the polygon drawing mode and sets the type of drawing interaction that the drawing manager should adhere to `freehand`.
@@ -191,34 +191,43 @@ The following table lists the type of editing supported by different types of sh
191
191
192
192
## Next steps
193
193
194
-
Learn how to use additional features of the drawing tools module:
194
+
Learn how to use more features of the drawing tools module:
195
195
196
196
> [!div class="nextstepaction"]
197
-
> [Add a drawing toolbar](map-add-drawing-toolbar.md)
197
+
> [Add a drawing toolbar]
198
198
199
199
> [!div class="nextstepaction"]
200
-
> [Get shape data](map-get-shape-data.md)
200
+
> [Get shape data]
201
201
202
202
> [!div class="nextstepaction"]
203
-
> [React to drawing events](drawing-tools-events.md)
203
+
> [React to drawing events]
204
204
205
205
> [!div class="nextstepaction"]
206
-
> [Interaction types and keyboard shortcuts](drawing-tools-interactions-keyboard-shortcuts.md)
206
+
> [Interaction types and keyboard shortcuts]
207
207
208
208
Learn more about the classes and methods used in this article:
0 commit comments