你總是可以做這樣的事情:
<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