嗨,我已经整理了如何在 bing 中映射我当前的位置
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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">
var map;
function GetMap()
{
// Set the map options
var mapOptions = {credentials:"xxxxxxx"};
// Initialize the map
map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), mapOptions);
// Initialize the location provider
var geoLocationProvider = new Microsoft.Maps.GeoLocationProvider(map);
// Get the user's current location
geoLocationProvider.getCurrentPosition({successCallback:displayCenter});
}
function displayCenter(args)
{
// Display the user location when the geo location request returns
alert("The user's location is " + args.center);
}
</script>
</head>
<body onload="GetMap();">
<div id='mapDiv' style="position:relative; width:400px; height:400px;"></div>
</body>
</html>
当我指定开始/结束坐标时,我还整理了如何让计算路线工作
<cfhttp timeout="10000" url="http://dev.virtualearth.net/REST/V1/Routes/Walking?wp.0=-27.491030,153.095764&wp.1=-27.476757,153.040493&o=xml&key=xxxxxxxxxxxxxx">
我想要做的是能够结合上述两个,以便我首先运行当前位置,然后将结果坐标传递给计算路线,以便 wp.0=#current location coordinates#