Skip to content

Commit 5a183c2

Browse files
authored
Merge pull request #286037 from stevemunk/attribute-update-drawing-tools-events
Updated images in article 'Drawing tools events' to show the new attribute and added lightbox to image.
2 parents a35073b + 5b88866 commit 5a183c2

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

articles/azure-maps/drawing-tools-events.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Drawing tools events | Microsoft Azure Maps
33
description: This article demonstrates how to add a drawing toolbar to a map using Microsoft Azure Maps Web SDK
44
author: sinnypan
55
ms.author: sipa
6-
ms.date: 05/23/2023
6+
ms.date: 09/03/2024
77
ms.topic: how-to
88
ms.service: azure-maps
99
ms.subservice: web-sdk
@@ -15,18 +15,18 @@ When using drawing tools on a map, it's useful to react to certain events as the
1515

1616
| Event | Description |
1717
|-------|-------------|
18-
| `drawingchanged` | Fired when any coordinate in a shape has been added or changed. |
18+
| `drawingchanged` | Fired when any coordinate in a shape is added or changed. |
1919
| `drawingchanging` | Fired when any preview coordinate for a shape is being displayed. For example, this event fires multiple times as a coordinate is dragged. |
20-
| `drawingcomplete` | Fired when a shape has finished being drawn or taken out of edit mode. |
20+
| `drawingcomplete` | Fired when a shape completes drawing or is taken out of edit mode. |
2121
| `drawingerased` | Fired when a shape is erased from the drawing manager when in `erase-geometry` mode. |
22-
| `drawingmodechanged` | Fired when the drawing mode has changed. The new drawing mode is passed into the event handler. |
22+
| `drawingmodechanged` | Fired when the drawing mode changes. The new drawing mode is passed into the event handler. |
2323
| `drawingstarted` | Fired when the user starts drawing a shape or puts a shape into edit mode. |
2424

25-
For a complete working sample of how to display data from a vector tile source on the map, see [Drawing tools events] in the [Azure Maps Samples]. In this sample you can draw shapes on the map and watch as the events fire. For the source code for this sample, see [Drawing tools events sample code].
25+
For a complete working sample of how to display data from a vector tile source on the map, see [Drawing tools events] in the [Azure Maps Samples]. This sample enables you to draw shapes on the map and watch as the events fire. For the source code for this sample, see [Drawing tools events sample code].
2626

2727
The following image shows a screenshot of the complete working sample that demonstrates how the events in the Drawing Tools module work.
2828

29-
:::image type="content" source="./media/drawing-tools-events/drawing-tools-events.png" alt-text="Screenshot showing a map displaying data from a vector tile source.":::
29+
:::image type="content" source="./media/drawing-tools-events/drawing-tools-events.png" lightbox="./media/drawing-tools-events/drawing-tools-events.png" alt-text="Screenshot showing a map displaying data from a vector tile source.":::
3030

3131
## Examples
3232

@@ -38,23 +38,23 @@ This code demonstrates how to monitor an event of a user drawing shapes. For thi
3838

3939
For a complete working sample of how to use the drawing tools to draw polygon areas on the map with points within them that can be selected, see [Select data in drawn polygon area] in the [Azure Maps Samples]. For the source code for this sample, see [Select data in drawn polygon area sample code].
4040

41-
:::image type="content" source="./media/drawing-tools-events/select-data-in-drawn-polygon-area.png" alt-text="Screenshot showing a map displaying points within polygon areas.":::
41+
:::image type="content" source="./media/drawing-tools-events/select-data-in-drawn-polygon-area.png" lightbox="./media/drawing-tools-events/select-data-in-drawn-polygon-area.png" alt-text="Screenshot showing a map displaying points within polygon areas.":::
4242

4343
### Draw and search in polygon area
4444

4545
This code searches for points of interests inside the area of a shape after the user finished drawing the shape. The `drawingcomplete` event is used to trigger the search logic. If the user draws a rectangle or polygon, a search inside geometry is performed. If a circle is drawn, the radius and center position is used to perform a point of interest search. The `drawingmodechanged` event is used to determine when the user switches to the drawing mode, and this event clears the drawing canvas.
4646

4747
For a complete working sample of how to use the drawing tools to search for points of interests within drawn areas, see [Draw and search polygon area] in the [Azure Maps Samples]. For the source code for this sample, see [Draw and search polygon area sample code].
4848

49-
:::image type="content" source="./media/drawing-tools-events/draw-and-search-polygon-area.png" alt-text="Screenshot showing a map displaying the Draw and search in polygon area sample.":::
49+
:::image type="content" source="./media/drawing-tools-events/draw-and-search-polygon-area.png" lightbox="./media/drawing-tools-events/draw-and-search-polygon-area.png" alt-text="Screenshot showing a map displaying the Draw and search in polygon area sample.":::
5050

5151
### Create a measuring tool
5252

53-
The following code shows how the drawing events can be used to create a measuring tool. The `drawingchanging` is used to monitor the shape, as it's being drawn. As the user moves the mouse, the dimensions of the shape are calculated. The `drawingcomplete` event is used to do a final calculation on the shape after it has been drawn. The `drawingmodechanged` event is used to determine when the user is switching into a drawing mode. Also, the `drawingmodechanged` event clears the drawing canvas and clears old measurement information.
53+
The following code shows how the drawing events can be used to create a measuring tool. The `drawingchanging` is used to monitor the shape, as it's being drawn. As the user moves the mouse, the dimensions of the shape are calculated. The `drawingcomplete` event is used to do a final calculation on the shape after drawing completes. The `drawingmodechanged` event is used to determine when the user is switching into a drawing mode. Also, the `drawingmodechanged` event clears the drawing canvas and clears old measurement information.
5454

5555
For a complete working sample of how to use the drawing tools to measure distances and areas, see [Create a measuring tool] in the [Azure Maps Samples]. For the source code for this sample, see [Create a measuring tool sample code].
5656

57-
:::image type="content" source="./media/drawing-tools-events/create-a-measuring-tool.png" alt-text="Screenshot showing a map displaying the measuring tool sample.":::
57+
:::image type="content" source="./media/drawing-tools-events/create-a-measuring-tool.png" lightbox="./media/drawing-tools-events/create-a-measuring-tool.png" alt-text="Screenshot showing a map displaying the measuring tool sample.":::
5858

5959
## Next steps
6060

289 KB
Loading
339 KB
Loading
361 KB
Loading
-182 KB
Loading

0 commit comments

Comments
 (0)