Skip to content

Commit 6eaa182

Browse files
authored
Merge pull request #110995 from stevemunk/set-drawing-options-CodePen
remove/replace CodePen samples from article: Use the drawing tools module.
2 parents c7351e8 + 4203c1f commit 6eaa182

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed
508 KB
Loading
829 KB
Loading

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

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
title: Drawing tools module | Microsoft Azure Maps
33
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
88
ms.service: azure-maps
9-
ms.custom:
109
---
1110

1211
# Use the drawing tools module
@@ -41,7 +40,7 @@ Once the drawing tools module is loaded in your application, you can enable draw
4140

4241
### Set the drawing mode
4342

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

4645
```javascript
4746
//Create an instance of the drawing manager and set drawing mode.
@@ -50,15 +49,15 @@ drawingManager = new atlas.drawing.DrawingManager(map,{
5049
});
5150
```
5251

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

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.":::
5655

56+
<!--------------------------------
5757
<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">
5858
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+
-------------------------------->
6261

6362
### Set the interaction type
6463

@@ -78,26 +77,28 @@ drawingManager = new atlas.drawing.DrawingManager(map,{
7877
});
7978
```
8079

80+
<!------------------------------
8181
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.
8282
8383
<br/>
8484
8585
<iframe height="500" scrolling="no" title="Free-hand drawing" src="//codepen.io/azuremaps/embed/ZEzKoaj/?height=265&theme-id=0&default-tab=js,result&editable=true" frameborder="no" allowtransparency="true" allowfullscreen="true">
8686
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+
------------------------------>
9089

9190
### Customizing drawing options
9291

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

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

97-
<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
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.":::
10097

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+
------------------------------>
101102

102103
### Put a shape into edit mode
103104

@@ -183,3 +184,5 @@ Learn more about the classes and methods used in this article:
183184
184185
> [!div class="nextstepaction"]
185186
> [Drawing toolbar](/javascript/api/azure-maps-drawing-tools/atlas.control.drawingtoolbar)
187+
188+
[Drawing manager options]: https://samples.azuremaps.com/drawing-tools-module/drawing-manager-options

0 commit comments

Comments
 (0)