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/how-to-use-map-control.md
+14-14Lines changed: 14 additions & 14 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: Learn how to add and localize maps to web and mobile applications by using the Map Control client-side JavaScript library in Azure Maps.
5
5
author: eriklindeman
6
6
ms.author: eriklind
7
-
ms.date: 11/29/2021
7
+
ms.date: 06/29/2023
8
8
ms.topic: how-to
9
9
ms.service: azure-maps
10
10
services: azure-maps
@@ -23,7 +23,7 @@ To use the Map Control in a web page, you must have one of the following prerequ
23
23
24
24
* An [Azure Maps account]
25
25
* A [subscription key]
26
-
* Obtain your Azure Active Directory (AAD) credentials with [authentication options]
26
+
* Obtain your Azure Active Directory (Azure AD) credentials with [authentication options]
27
27
28
28
## Create a new map in a web page
29
29
@@ -33,7 +33,7 @@ You can embed a map in a web page by using the Map Control client-side JavaScrip
33
33
34
34
2. Load in the Azure Maps Web SDK. You can choose one of two options:
35
35
36
-
* Use the globally hosted CDN version of the Azure Maps Web SDK by adding references to the JavaScript and stylesheet in the `<head>` element of the HTML file:
36
+
* Use the globally hosted CDN version of the Azure Maps Web SDK by adding references to the JavaScript and `stylesheet` in the `<head>` element of the HTML file:
@@ -80,7 +80,7 @@ You can embed a map in a web page by using the Map Control client-side JavaScrip
80
80
</body>
81
81
```
82
82
83
-
5.Now, we'll initialize the map control. In order to authenticate the control, you'll either need to own an Azure Maps subscription key or use Azure Active Directory (AAD) credentials with [authentication options](/javascript/api/azure-maps-control/atlas.authenticationoptions).
83
+
5.Next, initialize the map control. In order to authenticate the control, use an Azure Maps subscription key or Azure AD credentials with [authentication options](/javascript/api/azure-maps-control/atlas.authenticationoptions).
84
84
85
85
If you're using a subscription key for authentication, copy and paste the following script element inside the `<head>` element, and below the first `<script>` element. Replace `<Your Azure Maps Key>` with your Azure Maps subscription key.
86
86
@@ -101,7 +101,7 @@ You can embed a map in a web page by using the Map Control client-side JavaScrip
101
101
</script>
102
102
```
103
103
104
-
If you're using Azure Active Directory (AAD) for authentication, copy and paste the following script element inside the `<head>` element, and below the first `<script>` element.
104
+
If you're using Azure AD for authentication, copy and paste the following script element inside the `<head>` element, and below the first `<script>` element.
105
105
106
106
```HTML
107
107
<script type="text/javascript">
@@ -122,7 +122,7 @@ You can embed a map in a web page by using the Map Control client-side JavaScrip
122
122
</script>
123
123
```
124
124
125
-
For more information about authentication with Azure Maps, see the [Authentication with Azure Maps](azure-maps-authentication.md) document. For a list of samples showing how to integrate Azure Active Directory (AAD) with Azure Maps, see [Azure Maps & Azure Active Directory Samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples) in GitHub.
125
+
For more information about authentication with Azure Maps, see the [Authentication with Azure Maps](azure-maps-authentication.md) document. For a list of samples showing how to integrate Azure AD with Azure Maps, see [Azure Maps & Azure Active Directory Samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples) in GitHub.
126
126
127
127
>[!TIP]
128
128
>In this example, we've passed in the `id` of the map `<div>`. Another way to do this is to pass in the `HTMLElement` object by passing`document.getElementById('myMap')` as the first parameter.
@@ -137,7 +137,7 @@ You can embed a map in a web page by using the Map Control client-side JavaScrip
Azure Maps provides two different ways of setting the language and regional view for the rendered map. The first option is to add this information to the global `atlas` namespace, which will result in all map control instances in your app defaulting to these settings. The following sets the language to French ("fr-FR") and the regional view to "Auto":
200
+
Azure Maps provides two different ways of setting the language and regional view for the rendered map. The first option is to add this information to the global `atlas` namespace, which results in all map control instances in your app defaulting to these settings. The following sets the language to French ("fr-FR") and the regional view to "Auto":
201
201
202
202
```javascript
203
203
atlas.setLanguage('fr-FR');
@@ -223,15 +223,15 @@ map = new atlas.Map('myMap', {
223
223
> [!NOTE]
224
224
> It is possible to load multiple map instances on the same page with different language and region settings. Additionally, these settings can be updated after the map loads using the `setStyle` function of the map.
225
225
226
-
Here is an example of Azure Maps with the language set to "fr-FR" and the regional view set to "Auto".
226
+
Here's an example of Azure Maps with the language set to "fr-FR" and the regional view set to `Auto`.
227
227
228
228

229
229
230
230
For a list of supported languages and regional views, see [Localization support in Azure Maps](supported-languages.md).
231
231
232
232
## Azure Government cloud support
233
233
234
-
The Azure Maps Web SDK supports the Azure Government cloud. All JavaScript and CSS URLs used to access the Azure Maps Web SDK remain the same. The following tasks will need to be done to connect to the Azure Government cloud version of the Azure Maps platform.
234
+
The Azure Maps Web SDK supports the Azure Government cloud. All JavaScript and CSS URLs used to access the Azure Maps Web SDK remain the same. The following tasks need to be done to connect to the Azure Government cloud version of the Azure Maps platform.
235
235
236
236
When using the interactive map control, add the following line of code before creating an instance of the `Map` class.
Be sure to use Azure Maps authentication details from the Azure Government cloud platform when authenticating the map and services.
243
243
244
-
When using the services module, the domain for the services needs to be set when creating an instance of an API URL endpoint. For example, the following code creates an instance of the `SearchURL` class and points the domain to the Azure Government cloud.
244
+
The domain for the services needs to be set when creating an instance of an API URL endpoint, when using the services module. For example, the following code creates an instance of the `SearchURL` class and points the domain to the Azure Government cloud.
245
245
246
246
```javascript
247
247
var searchURL =newatlas.service.SearchURL(pipeline, 'atlas.azure.us');
@@ -278,7 +278,7 @@ Learn best practices and see samples:
0 commit comments