Forum Discussion

JadedBelle's avatar
JadedBelle
Copper Contributor
Jun 03, 2024

Azure Maps not displaying on .Net Framework Web App

Hi,

 

I just created a subscription for Azure Maps.  I'm using Visual Studio 2019 for my web application using .Net Framework 4.8, MVC.

 

My references in the layout web page are:

<!--Add reference to Azure Maps-->
<link href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/2/atlas.min.css" rel="stylesheet" type="text/css" />

<!-- Add a reference to the Azure Maps Services SDK JavaScript file. -->
<script src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/2/atlas.min.js"></script>

 

The function to initialize the Azure Maps is:

function GetMap() {
// Initialize a map instance.
map = new atlas.Map('divMap', {
center: [39.011902, -98.484247],
zoom: 5,
view: 'Auto',

// Add authentication details for connecting to Azure Maps.
authOptions: {
// 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',
clientId: azureMapsClientId,
subscriptionKey: azureKey
}
});
}

 

Why is the map not showing?  I just want to display a satellite imagery of the US as background map.

 

Appreciate any help.

 

 

 

Resources