Skip to content

Commit 0524fcb

Browse files
committed
Fix typo and code indentation errors
1 parent cdf6c36 commit 0524fcb

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

Samples/REST Services/Fill Address Form with Autosuggest/Fill Address Form with Autosuggest.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686

8787
function getExpiration(jwtToken) {
8888
// Decode the JWT token to get the expiration timestamp
89-
const json = atob(jwtToken.split(".")[1]); - const decode = JSON.parse(json);
89+
const json = atob(jwtToken.split(".")[1]);
90+
const decode = JSON.parse(json);
9091

9192
// Return the milliseconds until the token needs renewed
9293
// Reduce the time until renew by 2 minutes to avoid using an expired token
@@ -102,14 +103,16 @@
102103
// Create a repeating timeout that will renew the SAS token
103104
// This timeout must be cleared once the TokenCredential object is no longer needed
104105
// If the timeout is not cleared the memory used by the TokenCredential will never be reclaimed.
105-
const renewToken = async () => { - try {
106+
const renewToken = async () => {
107+
try {
106108
console.log("Renewing token");
107109
token = await getSasToken();
108110
tokenRenewalTimer = setTimeout(renewToken, getExpiration(token));
109-
} catch (error) {
110-
console.log("Caught error when renewing token"); - console.log("Caught error when renewing token");
111+
} catch (error) {
112+
console.log("Caught error when renewing token");
111113
clearTimeout(tokenRenewalTimer);
112-
throw error; - }
114+
throw error;
115+
}
113116
}
114117
tokenRenewalTimer = setTimeout(renewToken, getExpiration(token));
115118
}

Samples/REST Services/Simple REST Geocoding Request/Simple REST Geocoding Request.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<script>
1616
//Your Azure Maps Active Directory details for autheniticating the service.
17-
var tokenService = 'https://samples.azuremaps.com/api/GetAzureMapsSASToken';
17+
var tokenService = 'https://samples.azuremaps.com/api/GetAzureMapsSasToken';
1818

1919
var token;
2020

Samples/Services Module/Methods for geocoding multiple addresses/Methods for geocoding multiple addresses.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,8 @@
207207
var requestUrl = 'https://{azMapsDomain}/search/address/batch/sync/json?api-version=1.0';
208208
var res = await processPostRequest(requestUrl, body);
209209

210-
var r = await res.json();
211-
212210
//Process the response.
213-
processBatchResponse(r);
211+
processBatchResponse(res);
214212

215213
//Done.
216214
endSearch();

0 commit comments

Comments
 (0)