你总是可以做这样的事情:
<div id="location"></div>
<script type="text/javascript">
function initialize() {
var gpLatlng = new google.maps.LatLng(latitude, longitude);
var gpOptions = {
zoom: 15,
center: gpLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("location"), gpOptions);
var marker = new google.maps.Marker({
position: gpLatlng,
map: map,
title:"Title"
});
}
function loadScript() {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize®ion=GB";
document.body.appendChild(script);
}
window.onload = loadScript;
</script>
谢谢你所有这些,让我惊讶的是这些地图服务有多么强大!我已经探索过Bing了,因为我比Google更喜欢地图的外观。再次感谢! – mickburkejnr 2012-04-18 17:15:25
@mickburkejnr没问题。有一点需要记住的是,如果你想要在你的应用程序中使用商业应用程序,Bing Maps一般比谷歌地图要便宜得多。不过,Google地图目前比Bing地图拥有更好的Ortho图像。 – 2012-04-18 17:30:09
我会牢记这一点。非常感谢! – mickburkejnr 2012-04-19 09:31:14