Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions step-004-map-visualization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ Contoso Art Shipping is interested in being able to visualize in real-time the l

## Steps <!-- omit in toc -->

* [Create an Azure Maps account](#create-an-azure-maps-account)
* [Setup your local development environment](#setup-your-local-development-environment)
* [Complete the JavaScript code](#complete-the-javascript-code)
* [Replace global variables](#replace-global-variables)
* [Initialize the Maps component](#initialize-the-maps-component)
* [Create map layers, data sources, and mouse events](#create-map-layers-data-sources-and-mouse-events)
* [Map highlighting functions](#map-highlighting-functions)
* [Query TSI](#query-tsi)
* [Create a chart](#create-a-chart)
* [Test the application](#test-the-application)
- [Create an Azure Maps account](#create-an-azure-maps-account)
- [Setup your local development environment](#setup-your-local-development-environment)
- [Complete the JavaScript code](#complete-the-javascript-code)
- [Replace global variables](#replace-global-variables)
- [Initialize the Maps component](#initialize-the-maps-component)
- [Create map layers, data sources, and mouse events](#create-map-layers-data-sources-and-mouse-events)
- [Map highlighting functions](#map-highlighting-functions)
- [Query TSI](#query-tsi)
- [Create a chart](#create-a-chart)
- [Change the AuthenticationContext](#change-the-authenticationcontext)
- [Test the application](#test-the-application)

### Create an Azure Maps account

Expand Down Expand Up @@ -413,6 +414,21 @@ tsiClient.server.getTsqResults(token, TSI_FQDN, linechartTsqExpressions.map(func
});
```

#### Change the AuthenticationContext

Next to replacing the several `TODO`s throughout the [`script.js`](./webapp/script.js) file, we also need to change one placeholder in the [`auth.js`](./webapp/auth.js) file.

Replace the placeholder with your AAD TenantID in following section:

```javascript
authContext = new AuthenticationContext({
authContextProperties,
cacheLocation: 'localStorage',
tenant: '<Your_Azure_ActiveDirectory_Tenant_ID>',
clientId: '120d688d-1518-4cf7-bd38-182f158850b6'
});
```

### Test the application

Open a web browser and navigate to [https://insights-local.timeseries.azure.com/mapsexample.html](https://insights-local.timeseries.azure.com/mapsexample.html).
Expand Down
8 changes: 7 additions & 1 deletion step-004-map-visualization/webapp/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ function initAuth(title){
var authContextProperties = window.location.href.indexOf('tsiclientsample') !== -1
? { postLogoutRedirectUri: 'https://tsiclientsample.azurewebsites.net', clientId: '11a652b9-f29f-40c8-ab29-5ccbe2271823', cacheLocation: 'localStorage' }
: { postLogoutRedirectUri: 'https://insights.timeseries.azure.com', clientId: '120d688d-1518-4cf7-bd38-182f158850b6' , cacheLocation: 'localStorage'};
authContext = new AuthenticationContext(authContextProperties)

authContext = new AuthenticationContext({
authContextProperties,
cacheLocation: 'localStorage',
tenant: '<Your_Azure_ActiveDirectory_Tenant_ID>',
clientId: '120d688d-1518-4cf7-bd38-182f158850b6'
});

if (authContext.isCallback(window.location.hash)) {

Expand Down