File tree Expand file tree Collapse file tree
3D Elevation_experimental
Controls/Map Style Picker Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141
4242 // Add authentication details for connecting to Azure Maps
4343 authOptions : {
44- // Use Microsoft Entra ID authentication in production
45- authType : 'anonymous' ,
46- clientId : 'e6b6ab59-eb5d-4d25-aa57-581135b927f0' , // Your Azure Maps client id for accessing your Azure Maps account
44+ // Use SAS token for authentication
45+ authType : 'sas' ,
4746 getToken : function ( resolve , reject , map ) {
48- // URL to your authentication service that retrieves an Microsoft Entra ID Token
49- fetch ( 'https://samples.azuremaps.com/api/GetAzureMapsToken' )
50- . then ( function ( response ) {
51- return response . text ( ) ;
52- } )
53- . then ( function ( token ) {
54- resolve ( token ) ;
55- } )
56- . catch ( function ( error ) {
57- reject ( new Error ( `Failed to fetch Azure Maps token: ${ error . message } ` ) ) ;
58- } ) ;
47+ // URL to your authentication service that retrieves a SAS Token
48+ var tokenServiceUrl = 'https://samples.azuremaps.com/api/GetAzureMapsSasToken' ;
49+
50+ fetch ( tokenServiceUrl ) . then ( r => r . text ( ) ) . then ( token => resolve ( token ) ) ;
5951 }
6052
61- // Alternatively, use an Azure Maps key in development
62- // Get an Azure Maps key at https://azuremaps.com/
63- // NOTE: The primary key should be used as the key
53+ //Alternatively, use an Azure Maps key. Get an Azure Maps key at https://azure.com/maps. NOTE: The primary key should be used as the key.
6454 //authType: 'subscriptionKey',
6555 //subscriptionKey: '[YOUR_AZURE_MAPS_KEY]'
6656 }
Original file line number Diff line number Diff line change 9595
9696 // Add authentication details for connecting to Azure Maps.
9797 authOptions : {
98- //Use Microsoft Entra ID authentication.
99- authType : 'anonymous' ,
100- clientId : 'e6b6ab59-eb5d-4d25-aa57-581135b927f0' , // Your Azure Maps client id for accessing your Azure Maps account.
98+ // Use SAS token for authentication
99+ authType : 'sas' ,
101100 getToken : function ( resolve , reject , map ) {
102- // URL to your authentication service that retrieves an Microsoft Entra ID Token.
103- var tokenServiceUrl = 'https://samples.azuremaps.com/api/GetAzureMapsToken ' ;
101+ // URL to your authentication service that retrieves a SAS Token
102+ var tokenServiceUrl = 'https://samples.azuremaps.com/api/GetAzureMapsSasToken ' ;
104103
105104 fetch ( tokenServiceUrl ) . then ( r => r . text ( ) ) . then ( token => resolve ( token ) ) ;
106105 }
Original file line number Diff line number Diff line change 2828
2929 //Add authentication details for connecting to Azure Maps.
3030 authOptions : {
31- //Use Microsoft Entra ID authentication.
32- authType : 'anonymous' ,
33- clientId : 'e6b6ab59-eb5d-4d25-aa57-581135b927f0' , //Your Azure Maps client id for accessing your Azure Maps account.
31+ // Use SAS token for authentication
32+ authType : 'sas' ,
3433 getToken : function ( resolve , reject , map ) {
35- //URL to your authentication service that retrieves an Microsoft Entra ID Token.
36- var tokenServiceUrl = 'https://samples.azuremaps.com/api/GetAzureMapsToken ' ;
34+ // URL to your authentication service that retrieves a SAS Token
35+ var tokenServiceUrl = 'https://samples.azuremaps.com/api/GetAzureMapsSasToken ' ;
3736
3837 fetch ( tokenServiceUrl ) . then ( r => r . text ( ) ) . then ( token => resolve ( token ) ) ;
3938 }
40-
39+
4140 //Alternatively, use an Azure Maps key. Get an Azure Maps key at https://azure.com/maps. NOTE: The primary key should be used as the key.
4241 //authType: 'subscriptionKey',
4342 //subscriptionKey: '[YOUR_AZURE_MAPS_KEY]'
You can’t perform that action at this time.
0 commit comments