azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

This Azure Maps demo page did not work.

Open Erik4792 opened this issue 11 months ago • 1 comments

Azure Maps demo does not work.

I followed all instructions. Tried it in both Firefox and Edge browsers. Never saw a Los Angeles map. The Search, + or - buttons would not work.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Erik4792 avatar Mar 22 '24 21:03 Erik4792

@Erik4792 Thanks for your feedback! We will investigate and update as appropriate.

Naveenommi-MSFT avatar Mar 23 '24 04:03 Naveenommi-MSFT

@Erik4792 Here's what the specific code section should look like after the changes are made that the quickstart advises:

function GetMap() { //Initialize a map instance. map = new atlas.Map('myMap', { center: [-74.0060, 40.7128], zoom: 14, view: 'Auto',

            //Add authentication details for connecting to Azure Maps.
            authOptions: {
                //Use Azure Active Directory authentication.
                //authType: 'anonymous',
                //clientId: 'e6b6ab59-eb5d-4d25-aa57-581135b927f0', //Your Azure Maps client id for accessing your Azure Maps account.
                //getToken: function (resolve, reject, map) {
                    //URL to your authentication service that retrieves an Azure Active Directory Token.
                    //var tokenServiceUrl = "[https://samples.azuremaps.com/api/GetAzureMapsToken";](https://samples.azuremaps.com/api/GetAzureMapsToken%22;)

                    //fetch(tokenServiceUrl).then(r => r.text()).then(token => resolve(token));
                //}

                //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.
                authType: 'subscriptionKey',
                subscriptionKey: 'YourAzureMapsKey'
            }
        });
        
        
        
        

AjayBathini-MSFT avatar Mar 27 '24 07:03 AjayBathini-MSFT

@Erik4792 if there are any further questions regarding the documentation, please tag me in your reply and we will be happy to continue the conversation.

AjayBathini-MSFT avatar Mar 27 '24 07:03 AjayBathini-MSFT