0
我將我的代碼版本2版本3.我收到腳本錯誤在 http://maps.gstatic.com/intl/en_us/mapfiles/api-3/12/9/main.js 我的代碼在頁面上作爲轉換谷歌地圖API V2至V3獲得在main.js腳本錯誤
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&key=<%=strGk%>"></script>
<script type="text/javascript">
function initialize() {
var myOptions = {
zoom: 7,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: "<%=strOrig%>",
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
position: google.maps.ControlPosition.BOTTOM
},
navigationControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.ZOOM_PAN,
position: google.maps.ControlPosition.TOP_RIGHT
},
scaleControl: true,
scaleControlOptions: {
position: google.maps.ControlPosition.TOP_LEFT
}
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById("directions"));
google.maps.event.addListener(directionsDisplay, "addoverlay", afterDir);
google.maps.event.addListener(directionsDisplay, "error", handleErrors);
// geocoder = new GClientGeocoder();
geocoder = new google.maps.Geocoder();
有什麼錯誤?也有助於添加所有的JS代碼;你已經通過初始化函數部分截斷了它 – duncan 2013-04-25 12:39:42