Skip to content

Commit c721864

Browse files
committed
code formatting
1 parent 4231b89 commit c721864

File tree

4 files changed

+45
-45
lines changed

4 files changed

+45
-45
lines changed

articles/azure-maps/how-to-use-services-module.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -68,52 +68,52 @@ The Azure Maps Web SDK provides a *services module*. This module is a helper lib
6868
// This time-out must be cleared when the TokenCredential object is no longer needed.
6969
// If the time-out is not cleared, the memory used by the TokenCredential will never be reclaimed.
7070
var renewToken = async () => {
71-
try {
72-
console.log("Renewing token");
73-
var token = await getAadToken();
74-
tokenCredential.token = token;
75-
tokenRenewalTimer = setTimeout(renewToken, getExpiration(token));
76-
} catch (error) {
77-
console.log("Caught error when renewing token");
78-
clearTimeout(tokenRenewalTimer);
79-
throw error;
80-
}
71+
try {
72+
console.log("Renewing token");
73+
var token = await getAadToken();
74+
tokenCredential.token = token;
75+
tokenRenewalTimer = setTimeout(renewToken, getExpiration(token));
76+
} catch (error) {
77+
console.log("Caught error when renewing token");
78+
clearTimeout(tokenRenewalTimer);
79+
throw error;
80+
}
8181
}
8282
tokenRenewalTimer = setTimeout(renewToken, getExpiration(aadToken));
8383

8484
// Use tokenCredential to create a pipeline.
8585
var pipeline = atlas.service.MapsURL.newPipeline(tokenCredential, {
86-
retryOptions: { maxTries: 4 } // Retry options
86+
retryOptions: { maxTries: 4 } // Retry options
8787
});
8888

8989
// Create an instance of the SearchURL client.
9090
var searchURL = new atlas.service.SearchURL(pipeline);
9191

9292
function getAadToken() {
93-
// Use the signed-in auth context to get a token.
94-
return new Promise((resolve, reject) => {
95-
// The resource should always be https://atlas.microsoft.com/.
96-
const resource = "https://atlas.microsoft.com/";
97-
authContext.acquireToken(resource, (error, token) => {
98-
if (error) {
99-
reject(error);
100-
} else {
101-
resolve(token);
102-
}
103-
});
104-
})
93+
// Use the signed-in auth context to get a token.
94+
return new Promise((resolve, reject) => {
95+
// The resource should always be https://atlas.microsoft.com/.
96+
const resource = "https://atlas.microsoft.com/";
97+
authContext.acquireToken(resource, (error, token) => {
98+
if (error) {
99+
reject(error);
100+
} else {
101+
resolve(token);
102+
}
103+
});
104+
})
105105
}
106106

107107
function getExpiration(jwtToken) {
108-
// Decode the JSON Web Token (JWT) to get the expiration time stamp.
109-
const json = atob(jwtToken.split(".")[1]);
110-
const decode = JSON.parse(json);
111-
112-
// Return the milliseconds remaining until the token must be renewed.
113-
// Reduce the time until renewal by 5 minutes to avoid using an expired token.
114-
// The exp property is the time stamp of the expiration, in seconds.
115-
const renewSkew = 300000;
116-
return (1000 * decode.exp) - Date.now() - renewSkew;
108+
// Decode the JSON Web Token (JWT) to get the expiration time stamp.
109+
const json = atob(jwtToken.split(".")[1]);
110+
const decode = JSON.parse(json);
111+
112+
// Return the milliseconds remaining until the token must be renewed.
113+
// Reduce the time until renewal by 5 minutes to avoid using an expired token.
114+
// The exp property is the time stamp of the expiration, in seconds.
115+
const renewSkew = 300000;
116+
return (1000 * decode.exp) - Date.now() - renewSkew;
117117
}
118118
```
119119

articles/azure-maps/set-android-map-styles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The `mapcontrol_style` attribute above sets the map style to **grayscale_dark**.
5757
Map style can be set in the activity class. Copy the following code snippet into the **onCreate()** method of your `MainActivity.java` class. This will set the map style to **satellite_road_labels**.
5858

5959
```Java
60-
mapControl.onReady(map -> {
60+
mapControl.onReady(map -> {
6161
//Set the camera of the map.
6262
map.setCamera(center(47.64, -122.33), zoom(14));
6363

articles/azure-maps/supported-browsers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ manager: cpendleton
1414

1515
The Azure Maps Web SDK provides a helper function called [atlas.isSupported](https://docs.microsoft.com/javascript/api/azure-maps-control/atlas?view=azure-iot-typescript-latest#issupported-boolean-). This function detects whether a web browser has the minimum set of WebGL features required to support loading and rendering the map control. Here's an example of how to use the function:
1616

17-
```
18-
if(!atlas.isSupported()) {
17+
```JavaScript
18+
if (!atlas.isSupported()) {
1919
alert('Your browser is not supported by Azure Maps');
2020
} else if(!atlas.isSupported(true)) {
2121
alert('Your browser is supported by Azure Maps, but may have major performance caveats.');

articles/azure-maps/tutorial-iot-hub-maps.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,24 @@ In our use case, the rental cars are equipped with IoT devices that send telemet
3838
```JSON
3939
{
4040
"data": {
41-
"properties": {
41+
"properties": {
4242
"Engine": "ON"
43-
},
44-
"systemProperties": {
43+
},
44+
"systemProperties": {
4545
"iothub-content-type": "application/json",
4646
"iothub-content-encoding": "utf-8",
4747
"iothub-connection-device-id": "ContosoRentalDevice",
4848
"iothub-connection-auth-method": "{\"scope\":\"device\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",
4949
"iothub-connection-auth-generation-id": "636959817064335548",
5050
"iothub-enqueuedtime": "2019-06-18T00:17:20.608Z",
5151
"iothub-message-source": "Telemetry"
52-
},
53-
"body": {
54-
"location": {
55-
"type": "Point",
56-
"coordinates": [ -77.025988698005662, 38.9015330523316 ]
57-
}
58-
}
52+
},
53+
"body": {
54+
"location": {
55+
"type": "Point",
56+
"coordinates": [ -77.025988698005662, 38.9015330523316 ]
57+
}
58+
}
5959
}
6060
}
6161
```

0 commit comments

Comments
 (0)