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
+22-19Lines changed: 22 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,11 @@
1
1
---
2
2
title: Drawing tools module | Microsoft Azure Maps
3
3
description: In this article, you'll learn how to set drawing options data using the Microsoft Azure Maps Web SDK
4
-
author: eriklindeman
5
-
ms.author: eriklind
6
-
ms.date: 01/29/2020
7
-
ms.topic: conceptual
4
+
author: dubiety
5
+
ms.author: yuchungchen
6
+
ms.date: 06/15/2023
7
+
ms.topic: how-to
8
8
ms.service: azure-maps
9
-
ms.custom:
10
9
---
11
10
12
11
# Use the drawing tools module
@@ -41,7 +40,7 @@ Once the drawing tools module is loaded in your application, you can enable draw
41
40
42
41
### Set the drawing mode
43
42
44
-
The following code creates an instance of the drawing manager and sets the drawing **mode** option.
43
+
The following code creates an instance of the drawing manager and sets the drawing **mode** option.
45
44
46
45
```javascript
47
46
//Create an instance of the drawing manager and set drawing mode.
@@ -50,15 +49,15 @@ drawingManager = new atlas.drawing.DrawingManager(map,{
50
49
});
51
50
```
52
51
53
-
The code below is a complete running example of how to set a drawing mode of the drawing manager. Click the map to start drawing a polygon.
52
+
The following image is an example of drawing mode of the `DrawingManager`. Select any place on the map to start drawing a polygon.
54
53
55
-
<br/>
54
+
:::image type="content" source="./media/set-drawing-options/drawing-mode.gif"alt-text="A screenshot of a map showing central park in New York City where the drawing manager is demonstrated by drawing line.":::
56
55
56
+
<!--------------------------------
57
57
<iframe height="500" scrolling="no" title="Draw a polygon" src="//codepen.io/azuremaps/embed/YzKVKRa/?height=265&theme-id=0&default-tab=js,result&editable=true" frameborder="no" allowtransparency="true" allowfullscreen="true">
58
58
See the Pen <a href='https://codepen.io/azuremaps/pen/YzKVKRa/'>Draw a polygon</a> by Azure Maps
59
-
(<a href='https://codepen.io/azuremaps'>@azuremaps</a>) on <a href='https://codepen.io'>CodePen</a>.
60
-
</iframe>
61
-
59
+
(<a href='https://codepen.io/azuremaps'>@azuremaps</a>) on <a href='https://codepen.io'>CodePen</a>.</iframe>
60
+
-------------------------------->
62
61
63
62
### Set the interaction type
64
63
@@ -78,26 +77,28 @@ drawingManager = new atlas.drawing.DrawingManager(map,{
78
77
});
79
78
```
80
79
80
+
<!------------------------------
81
81
This code sample implements the functionality of drawing a polygon on the map. Just hold down the left mouse button and dragging it around, freely.
See the Pen <a href='https://codepen.io/azuremaps/pen/ZEzKoaj/'>Free-hand drawing</a> by Azure Maps
87
-
(<a href='https://codepen.io/azuremaps'>@azuremaps</a>) on <a href='https://codepen.io'>CodePen</a>.
88
-
</iframe>
89
-
87
+
(<a href='https://codepen.io/azuremaps'>@azuremaps</a>) on <a href='https://codepen.io'>CodePen</a>.</iframe>
88
+
------------------------------>
90
89
91
90
### Customizing drawing options
92
91
93
-
The previous examples demonstrated how to customize drawing options while instantiating the Drawing Manager. You can also set the Drawing Manager options by using the `drawingManager.setOptions()` function. Below is a tool to test out customization of all options for the drawing manager using the setOptions function.
92
+
The previous examples demonstrated how to customize drawing options while instantiating the Drawing Manager. You can also set the Drawing Manager options by using the `drawingManager.setOptions()` function.
94
93
95
-
<br/>
94
+
The [Drawing manager options] can be used to test out customization of all options for the drawing manager using the `setOptions` function.
96
95
97
-
<iframeheight="685"title="Customize drawing manager"src="//codepen.io/azuremaps/embed/LYPyrxR/?height=600&theme-id=0&default-tab=result"frameborder="no"allowtransparency="true"allowfullscreen="true">See the Pen <a href='https://codepen.io/azuremaps/pen/LYPyrxR/'>Get shape data</a> by Azure Maps
98
-
(<a href='https://codepen.io/azuremaps'>@azuremaps</a>) on <a href='https://codepen.io'>CodePen</a>.
99
-
</iframe>
96
+
:::image type="content" source="./media/set-drawing-options/drawing-manager-options.png"alt-text="A screenshot of a map showing Seattle with an area to the left of the map showing the drawing manager options that can be set, updating immediately in the map.":::
100
97
98
+
<!------------------------------
99
+
<iframe height="685" title="Customize drawing manager" src="//codepen.io/azuremaps/embed/LYPyrxR/?height=600&theme-id=0&default-tab=result" frameborder="no" allowtransparency="true" allowfullscreen="true">See the Pen <a href='https://codepen.io/azuremaps/pen/LYPyrxR/'>Get shape data</a> by Azure Maps
100
+
(<a href='https://codepen.io/azuremaps'>@azuremaps</a>) on <a href='https://codepen.io'>CodePen</a>.</iframe>
101
+
------------------------------>
101
102
102
103
### Put a shape into edit mode
103
104
@@ -183,3 +184,5 @@ Learn more about the classes and methods used in this article:
0 commit comments