googlemap에 여러 마커가 포함 된 배열이 있습니다. 지도에이 배열을 추가하려고하면이 오류가 발생합니다. 어떤 아이디어? 여기 자바 스크립트 : TypeError : a 정의되지 않았습니다 - 무엇이 잘못 되었나요?
내 코드입니다 :markers = [];
function create_station_marker(position){
if(position != null){
eval(position);
var latitude = parseFloat(position.latitude);
var longitude = parseFloat(position.longitude);
var new_icon = new GIcon();
new_icon.image = "marker.png";
new_icon.size = new GSize(25,17);
var opt;
opt = {};
opt.icon = new_icon;
var marker = new GMarker(new GLatLng(latitude, longitude),opt);
markers.push(marker);
}
}
내가지도에 내 배열을 추가 곳이다 : 그것에 대해
function load_googlemap() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(48.092757,11.645508), 4);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
for (var i=0; i< markers.length; i++) {
try{
map.addOverlay(markers[i]);
alert(markers[i].toSource());
}catch(ex){
//here I get this error!!!
alert(ex);
}
}
}
}
어떤 아이디어? 당신이 그것을 통해 평가를 일단
왜'평가 (위치),'? –
위치는 json입니다. – Newbie
몇 가지 샘플 데이터가있는 과거의 전체 예제를 보내주십시오. – user160820