Azure地图-无法查看地图



我一直在学习本教程(https://learn.microsoft.com/en-us/learn/modules/create-your-first-iot-central-app/)在第四单元,我遵循了所有的步骤,但我能看到的只是一张空白的页面,就像这个

第四单元演习结果

<!DOCTYPE html>
<html>
<head>
<title>Map</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Add references to the Azure Maps Map control JavaScript and CSS files. -->
<link rel="stylesheet" href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/2/atlas.min.css" type="text/css">
<script src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/2/atlas.min.js"></script>
<!-- Add a reference to the Azure Maps Services Module JavaScript file. -->
<script src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/2/atlas-service.min.js"></script>
<script>
function GetMap() {
//Instantiate a map object
var map = new atlas.Map("myMap", {
//Add your Azure Maps subscription key to the map SDK. Get an Azure Maps key at https://azure.com/maps
authOptions: {
authType: 'subscriptionKey',
subscriptionKey: 'mB~~~~~~(I wrote my maps primary key here)'
}
});
}
</script>
<style>
html,
body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
#myMap {
width: 100%;
height: 100%;
}
</style>
</head>
<body onload="GetMap()">
<div id="myMap"></div>
</body>
</html>

Azure地图资源

此反馈页面也不起作用。。。(https://feedback.azuremaps.com/)

反馈映射

此外,在这个网站上,当我按下";在新选项卡中打开";,我什么都看不见。。。(https://azuremapscodesamples.azurewebsites.net/)

代码示例映射

我花了将近4个小时,却找不到解决方案。。。我需要做些什么才能在这些页面上看到正确的地图?

如果所有使用Azure地图的不同网站都不适合您,可能是以下原因之一:

  • 请确保您所在的区域受支持。Azure地图不适用于位于中国或韩国的用户,对该平台的请求被主动阻止
  • 您使用的浏览器不受支持:https://learn.microsoft.com/en-us/azure/azure-maps/supported-browsers
  • WebGL在浏览器中被禁用,或者无法工作。请尝试此示例:https://azuremapscodesamples.azurewebsites.net/Map/Detect%20if%20browser%20is%20supported.html
  • 您的显卡有问题,请尝试更新驱动程序

检查地图如何启动

$(document).ready(function () {
InitMap();
});

最新更新