|
17 | 17 | <link href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.css" rel="stylesheet" /> |
18 | 18 | <script src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.js"></script> |
19 | 19 |
|
| 20 | + <!-- Add a reference to the Azure Maps Services Module JavaScript file. --> |
| 21 | + <script src="https://atlas.microsoft.com/sdk/javascript/service/2/atlas-service.min.js"></script> |
| 22 | + |
20 | 23 | <!-- Add a reference to the Azure Maps Rest Helper JavaScript file. --> |
21 | 24 | <script src="https://samples.azuremaps.com/lib/azure-maps/azure-maps-helper.min.js"></script> |
22 | 25 |
|
|
146 | 149 | map.layers.add(new atlas.layer.BubbleLayer(datasource)); |
147 | 150 | }); |
148 | 151 |
|
| 152 | + //Use MapControlCredential to share authentication between a map control and the service module. |
| 153 | + var pipeline = atlas.service.MapsURL.newPipeline(new atlas.service.MapControlCredential(map)); |
| 154 | + |
149 | 155 | //Create an instance of the SearchURL client. |
150 | | - searchURL = new atlas.service.SearchURL(pipeline, atlas.getDomain()); |
| 156 | + searchURL = new atlas.service.SearchURL(pipeline); |
151 | 157 | } |
152 | 158 |
|
153 | 159 | var searchMethod; |
|
223 | 229 | var requestUrl = 'https://{azMapsDomain}/search/address/batch/json?api-version=1.0'; |
224 | 230 | var res = await processPostRequest(requestUrl, body); |
225 | 231 |
|
226 | | - //Ge tthe batch status URL from the "location" response header. |
| 232 | + //Get the batch status URL from the "location" response header. |
227 | 233 | var batchStatusUrl = res.headers.get('location'); |
| 234 | + var signedRequest = await signRequest(requestUrl); |
228 | 235 |
|
229 | | - //Check the statuc of the batch job. |
| 236 | + //Check the status of the batch job. |
230 | 237 | var res2 = await fetch(batchStatusUrl, { |
231 | | - headers: new Headers(requestParams.headers) |
| 238 | + headers: new Headers(signedRequest.headers) |
232 | 239 | }); |
233 | 240 |
|
234 | 241 | //Check to see if batch process if complete. |
|
0 commit comments