0
我很確定我的一切都正確。你能否爲我檢查一下。它給了我在控制檯這個錯誤:「未捕獲錯誤:0值不是函數(從另一種語言翻譯)正確」我不明白爲什麼這不起作用。地圖不加載
function map_load() {
var draw;
var coords = Array(23.078412614088098, 57.33448100333726,
23.07858534246487, 57.33415377383744,
23.078234950383354, 57.33415913825547,
23.078190534420507, 57.334582927279826,
23.07792403833525, 57.3352266574434);
var s = -2;
var triangleCoords = [];
var coords_num = coords.length/2;
for (i = 0; i < coords_num ; i++) {
s += 2;
triangleCoords[i] = google.maps.LatLng(coords[s],coords[s+1]);
}
var center1 = google.maps.LatLng(coords[0], coords[1]);
if (coords.length > 1) {
draw = new google.maps.Polygon({
paths: triangleCoords,
strokeColor: "#FF0000",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#FF0000",
fillOpacity: 0.35
});
} else {
draw = new google.maps.Marker({
position: triangleCoords,
title:"your item location"
});
}
var myOptions = {
zoom: 16,
center: center1,
panControl:false,
streetViewControl:false,
mapTypeId: google.maps.MapTypeId.HYBRID
};
var map = new google.maps.Map(document.getElementById("map"), myOptions);
draw.setMap(map);
}
什麼線你得到的錯誤? – 2011-12-21 21:40:00
main.js,line 1 character 28 – 2011-12-21 21:42:43
main.js從[link]獲取(maps.gstatic.com/cat_js/intl/ar_ALL/mapfiles/api-3/7/5) – 2011-12-21 21:44:43