Skip to content

Commit 260d74c

Browse files
committed
Added links to sample source code in articles create-data-source-web-sdk.md
& drawing-tools-events.md
1 parent 69b6dfe commit 260d74c

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

articles/azure-maps/create-data-source-web-sdk.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ var flowLayer = new atlas.layer.LineLayer(source, null, {
124124
map.layers.add(flowLayer, 'labels');
125125
```
126126

127-
For a complete working sample of how to display data from a vector tile source on the map, see [Vector tile line layer] in the [Azure Maps Samples].
127+
For a complete working sample of how to display data from a vector tile source on the map, see [Vector tile line layer] in the [Azure Maps Samples]. For the source code for this sample, see [Vector tile line layer sample code].
128128

129129
:::image type="content" source="./media/create-data-source-web-sdk/vector-tile-line-layer.png" alt-text="Screenshot showing a map displaying data from a vector tile source.":::
130130

@@ -289,4 +289,5 @@ See the following articles for more code samples to add to your maps:
289289
[Mapbox Vector Tile Specification]: https://github.com/mapbox/vector-tile-spec
290290
291291
[Vector tile line layer]: https://samples.azuremaps.com/vector-tiles/vector-tile-line-layer
292+
[Vector tile line layer sample code]: https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/main/Samples/Vector%20tiles/Vector%20tile%20line%20layer/Vector%20tile%20line%20layer.html
292293
[Azure Maps Samples]: https://samples.azuremaps.com

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Drawing tool events | Microsoft Azure Maps
2+
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: dubiety
55
ms.author: yuchungchen
@@ -9,7 +9,7 @@ ms.service: azure-maps
99
services: azure-maps
1010
---
1111

12-
# Drawing tool events
12+
# Drawing tools events
1313

1414
When using drawing tools on a map, it's useful to react to certain events as the user draws on the map. This table lists all events supported by the `DrawingManager` class.
1515

@@ -22,7 +22,7 @@ When using drawing tools on a map, it's useful to react to certain events as the
2222
| `drawingmodechanged` | Fired when the drawing mode has changed. 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 tool events] in the [Azure Maps Samples]. In this sample you can draw shapes on the map and watch as the events fire.
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].
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

@@ -46,7 +46,7 @@ Let's see some common scenarios that use the drawing tools events.
4646

4747
This code demonstrates how to monitor an event of a user drawing shapes. For this example, the code monitors shapes of polygons, rectangles, and circles. Then, it determines which data points on the map are within the drawn area. The `drawingcomplete` event is used to trigger the select logic. In the select logic, the code loops through all the data points on the map. It checks if there's an intersection of the point and the area of the drawn shape. This example makes use of the open-source [Turf.js](https://turfjs.org/) library to perform a spatial intersection calculation.
4848

49-
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].
49+
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].
5050

5151
:::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.":::
5252

@@ -63,7 +63,7 @@ For a complete working sample of how to use the drawing tools to draw polygon ar
6363

6464
This code searches for points of interests inside the area of a shape after the user finished drawing the shape. You can modify and execute the code by clicking 'Edit on Code pen' on the top-right corner of the frame. 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.
6565

66-
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].
66+
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].
6767

6868
:::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.":::
6969

@@ -80,7 +80,7 @@ For a complete working sample of how to use the drawing tools to search for poin
8080

8181
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.
8282

83-
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].
83+
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].
8484

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

@@ -112,7 +112,11 @@ Check out more code samples:
112112
> [Code sample page](https://aka.ms/AzureMapsSamples)
113113
114114
[Azure Maps Samples]:https://samples.azuremaps.com
115-
[Drawing tool events]: https://samples.azuremaps.com/drawing-tools-module/drawing-tools-events
115+
[Drawing tools events]: https://samples.azuremaps.com/drawing-tools-module/drawing-tools-events
116+
[Drawing tools events sample code]: https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/main/Samples/Drawing%20Tools%20Module/Drawing%20tools%20events/Drawing%20tools%20events.html
116117
[Select data in drawn polygon area]: https://samples.azuremaps.com/drawing-tools-module/select-data-in-drawn-polygon-area
118+
[Select data in drawn polygon area sample code]: https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/main/Samples/Drawing%20Tools%20Module/Select%20data%20in%20drawn%20polygon%20area/Select%20data%20in%20drawn%20polygon%20area.html
117119
[Draw and search polygon area]: https://samples.azuremaps.com/drawing-tools-module/draw-and-search-polygon-area
120+
[Draw and search polygon area sample code]: https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/main/Samples/Drawing%20Tools%20Module/Draw%20and%20search%20polygon%20area/Draw%20and%20search%20polygon%20area.html
118121
[Create a measuring tool]: https://samples.azuremaps.com/drawing-tools-module/create-a-measuring-tool
122+
[Create a measuring tool sample code]: https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/main/Samples/Drawing%20Tools%20Module/Create%20a%20measuring%20tool/Create%20a%20measuring%20tool.html

0 commit comments

Comments
 (0)