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/tutorial-prioritized-routes.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ titleSuffix: Microsoft Azure Maps
4
4
description: Tutorial on how to use Azure Maps to find routes for specific travel modes to points of interest. See how to display multiple routes on maps.
5
5
author: sinnypan
6
6
ms.author: sipa
7
-
ms.date: 12/29/2021
7
+
ms.date: 09/03/2024
8
8
ms.topic: tutorial
9
9
ms.service: azure-maps
10
10
ms.subservice: web-sdk
@@ -78,10 +78,10 @@ The following steps show you how to create and display the Map control in a web
78
78
</html>
79
79
```
80
80
81
-
Some things to know about the above HTML:
81
+
Some things to know about the HTML:
82
82
83
83
* The HTML header includes CSS and JavaScript resource files hosted by the Azure Map Control library.
84
-
* The `onload` event in the body of the page calls the `GetMap` function when the body of the page has loaded.
84
+
* The `onload` event in the body of the page calls the `GetMap` function when the body of the page finishes loading.
85
85
* The `GetMap` function contains the inline JavaScript code used to access the Azure Maps API.
86
86
87
87
3. Next, add the following JavaScript code to the `GetMap` function, just beneath the code added in the last step. This code creates a map control and initializes it using your Azure Maps subscription keys that you provide. Make sure and replace the string `<YourAzureMapsSubscriptionKey>` with the Azure Maps subscription key that you copied from your Maps account.
@@ -97,15 +97,15 @@ The following steps show you how to create and display the Map control in a web
97
97
});
98
98
```
99
99
100
-
Some things to know about the above JavaScript:
100
+
Some things to know about the JavaScript:
101
101
102
102
* This code is the core of the `GetMap` function, which initializes the Map Control API for your Azure Maps account.
103
103
* [atlas] is the namespace that contains the Azure Maps API and related visual components.
104
104
* [atlas.Map] provides the control for a visual and interactive web map.
105
105
106
106
4. Save the file and open it in your browser. The browser displays a basic map by calling `atlas.Map` using your Azure Maps subscription key.
107
107
108
-
:::image type="content" source="./media/tutorial-prioritized-routes/basic-map.png" alt-text="A screenshot that shows the most basic map you can make by calling the atlas Map API, using your Azure Maps subscription key.":::
108
+
:::image type="content" source="./media/tutorial-prioritized-routes/basic-map.png" lightbox="./media/tutorial-prioritized-routes/basic-map.png" alt-text="A screenshot that shows the most basic map you can make by calling the atlas Map API, using your Azure Maps subscription key.":::
109
109
110
110
## Render real-time traffic data on a map
111
111
@@ -120,7 +120,7 @@ The following steps show you how to create and display the Map control in a web
120
120
});
121
121
```
122
122
123
-
Some things to know about the above JavaScript:
123
+
Some things to know about the JavaScript:
124
124
125
125
* This code implements the Map control's `ready` event handler. The rest of the code in this tutorial is placed inside the `ready` event handler.
126
126
* In the map `ready` event handler, the traffic flow setting on the map is set to `relative`, which is the speed of the road relative to free-flow.
@@ -167,13 +167,13 @@ In this tutorial, two routes are calculated on the map. The first route is calcu
167
167
168
168
```
169
169
170
-
Some things to know about the above JavaScript:
170
+
Some things to know about the JavaScript:
171
171
172
172
* In the Map control's `ready` event handler, a data source is created to store the route from start to finish.
173
173
* [Expressions] are used to retrieve the line width and color from properties on the route line feature.
174
-
* To ensure that the route line doesn't cover up the road labels, we've passed a second parameter with the value of `'labels'`.
174
+
* To ensure that the route line doesn't cover up the road labels, pass a second parameter with the value of `'labels'`.
175
175
176
-
Next, a symbol layer is created and attached to the data source. This layer specifies how the start and end points are rendered. Expressions have been added to retrieve the icon image and text label information from properties on each point object. To learn more about expressions, see [Data-driven style expressions].
176
+
Next, a symbol layer is created and attached to the data source. This layer specifies how the start and end points are rendered. Expressions are added to retrieve the icon image and text label information from properties on each point object. To learn more about expressions, see [Data-driven style expressions].
177
177
178
178
2. Next, set the start point as a fictitious company in Seattle called *Fabrikam*, and the end point as a Microsoft office. In the Map control's `ready` event handler, append the following code.
179
179
@@ -200,7 +200,7 @@ In this tutorial, two routes are calculated on the map. The first route is calcu
200
200
201
201
```
202
202
203
-
About the above JavaScript:
203
+
About the JavaScript:
204
204
205
205
* This code creates two [GeoJSON Point objects] to represent start and end points, which are then added to the data source.
206
206
* The last block of code sets the camera view using the latitude and longitude of the start and end points.
@@ -304,7 +304,7 @@ This section shows you how to use the Azure Maps Route service to get directions
304
304
});
305
305
```
306
306
307
-
About the above JavaScript:
307
+
About the JavaScript:
308
308
309
309
* This code queries the Azure Maps routing service through the [Azure Maps Route Directions API] method.
310
310
* The route line is then created from the coordinates of each turn and added to the data source.
0 commit comments