Skip to content

Commit 345ebcc

Browse files
authored
Merge pull request #112551 from stevemunk/set-drawing-options
minor updates to "Use the drawing tools module"
2 parents 23a0381 + 62f3a61 commit 345ebcc

File tree

1 file changed

+28
-19
lines changed

1 file changed

+28
-19
lines changed

articles/azure-maps/set-drawing-options.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Drawing tools module
33
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
55
author: dubiety
66
ms.author: yuchungchen
77
ms.date: 06/15/2023
@@ -11,20 +11,20 @@ ms.service: azure-maps
1111

1212
# Use the drawing tools module
1313

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.
1515

1616
## Loading the drawing tools module in a webpage
1717

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].
1919
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:
2121

2222
```html
2323
<link rel="stylesheet" href="https://atlas.microsoft.com/sdk/javascript/drawing/1/atlas-drawing.min.css" type="text/css" />
2424
<script src="https://atlas.microsoft.com/sdk/javascript/drawing/1/atlas-drawing.min.js"></script>
2525
```
2626

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](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:
2828

2929
`npm install azure-maps-drawing-tools`
3030

@@ -34,7 +34,7 @@ The Azure Maps Web SDK provides a [drawing tools module]. This module makes it e
3434
import * as drawing from "azure-maps-drawing-tools";
3535
```
3636

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].
3838

3939
To begin, install style-loader and css-loader:
4040

@@ -67,7 +67,7 @@ The Azure Maps Web SDK provides a [drawing tools module]. This module makes it e
6767

6868
## Use the drawing manager directly
6969

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.
7171

7272
### Set the drawing mode
7373

@@ -95,7 +95,7 @@ The following image is an example of drawing mode of the `DrawingManager`. Selec
9595
The drawing manager supports three different ways of interacting with the map to draw shapes.
9696

9797
- `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.
9999
- `hybrid` - Coordinates are added when the mouse or touch is clicked or dragged.
100100

101101
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
191191

192192
## Next steps
193193

194-
Learn how to use additional features of the drawing tools module:
194+
Learn how to use more features of the drawing tools module:
195195

196196
> [!div class="nextstepaction"]
197-
> [Add a drawing toolbar](map-add-drawing-toolbar.md)
197+
> [Add a drawing toolbar]
198198
199199
> [!div class="nextstepaction"]
200-
> [Get shape data](map-get-shape-data.md)
200+
> [Get shape data]
201201
202202
> [!div class="nextstepaction"]
203-
> [React to drawing events](drawing-tools-events.md)
203+
> [React to drawing events]
204204
205205
> [!div class="nextstepaction"]
206-
> [Interaction types and keyboard shortcuts](drawing-tools-interactions-keyboard-shortcuts.md)
206+
> [Interaction types and keyboard shortcuts]
207207
208208
Learn more about the classes and methods used in this article:
209209

210210
> [!div class="nextstepaction"]
211-
> [Map](/javascript/api/azure-maps-control/atlas.map)
211+
> [Map]
212212
213213
> [!div class="nextstepaction"]
214-
> [Drawing manager](/javascript/api/azure-maps-drawing-tools/atlas.drawing.drawingmanager)
214+
> [Drawing manager]
215215
216216
> [!div class="nextstepaction"]
217-
> [Drawing toolbar](/javascript/api/azure-maps-drawing-tools/atlas.control.drawingtoolbar)
217+
> [drawing toolbar]
218218
219-
[Drawing manager options]: https://samples.azuremaps.com/drawing-tools-module/drawing-manager-options
220-
[Webpack]: https://webpack.js.org/
221-
[style-loader]: https://webpack.js.org/loaders/style-loader/
219+
[Add a drawing toolbar]: map-add-drawing-toolbar.md
220+
[azure-maps-drawing-tools]: https://www.npmjs.com/package/azure-maps-drawing-tools
222221
[Drawing manager options source code]: https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/main/Samples/Drawing%20Tools%20Module/Drawing%20manager%20options/Drawing%20manager%20options.html
222+
[Drawing manager options]: https://samples.azuremaps.com/drawing-tools-module/drawing-manager-options
223+
[drawing manager]: /javascript/api/azure-maps-drawing-tools/atlas.drawing.drawingmanager
224+
[drawing toolbar]: /javascript/api/azure-maps-drawing-tools/atlas.control.drawingtoolbar
223225
[drawing tools module]: https://www.npmjs.com/package/azure-maps-drawing-tools
226+
[Get shape data]: map-get-shape-data.md
224227
[How to use the Azure Maps map control npm package]: how-to-use-npm-package.md
228+
[implement the map as usual]: how-to-use-map-control.md
229+
[Interaction types and keyboard shortcuts]: drawing-tools-interactions-keyboard-shortcuts.md
230+
[Map]: /javascript/api/azure-maps-control/atlas.map
231+
[React to drawing events]: drawing-tools-events.md
232+
[style-loader]: https://webpack.js.org/loaders/style-loader/
233+
[Webpack]: https://webpack.js.org/

0 commit comments

Comments
 (0)