gpt4 book ai didi

javascript - 在 html 网页上添加 bingmap javascript 错误

转载 作者:行者123 更新时间:2023-11-30 10:51:39 25 4
gpt4 key购买 nike

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>

<script type="text/javascript">
function GetMap()
{

var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"),
{credentials: "Your Bing Maps Key",
center: new Microsoft.Maps.Location(45.5, -122.5),
mapTypeId: Microsoft.Maps.MapTypeId.road,
zoom: 7});
}
</script>
</head>
<body onload="GetMap();">
<div id='mapDiv' style="position:relative; width:400px; height:400px;"></div>
</body>
</html>

我什至尝试加载一个简单的 map ,但我在未定义的 Microsoft 类上遇到 js 错误

最佳答案

将以下行添加到页面的 部分,在上面粘贴的部分之前:

<script src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0" type="text/javascript"
charset="UTF-8"></script>

关于javascript - 在 html 网页上添加 bingmap javascript 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4957567/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com