gpt4 book ai didi

php - 如何在我的网站中嵌入指向办公地点的 Bing map ?

转载 作者:行者123 更新时间:2023-11-30 05:58:53 34 4
gpt4 key购买 nike

如何在我的网站中嵌入 Bing map ,通过描述性信息窗口指向我的办公地址?

最佳答案

这是一个例子:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Infobox set location</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">
var map = null;

function getMap()
{
map = new Microsoft.Maps.Map(document.getElementById('myMap'), {credentials: 'Your Bing Maps Key'});
}

function setInfoBoxLocation()
{
map.entities.clear();
var infoboxOptions = {width :200, height :100, showCloseButton: true, zIndex: 0, offset:new Microsoft.Maps.Point(10,0), showPointer: true, title:'Infobox Title', description:'Infobox description' };
var defaultInfobox = new Microsoft.Maps.Infobox(map.getCenter(), infoboxOptions );
map.entities.push(defaultInfobox);
defaultInfobox.setLocation(new Microsoft.Maps.Location(47.4, -122.33));
}
</script>
</head>
<body onload="getMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
<div>
<input type="button" value="SetInfoBoxLocation" onclick="setInfoBoxLocation();" />
</div>
</body>
</html>

这里还有一些例子:http://www.bingmapsportal.com/ISDK/AjaxV7

关于php - 如何在我的网站中嵌入指向办公地点的 Bing map ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10031600/

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