2011-11-01 2 views
0

Google지도 아이콘이 처음으로로드되지 않습니다.

 marker.setPosition(latlng); 

왜 이런 경우입니까? 이것은 FF, IE 및 크롬 등/

를 테스트 한 모든 브라우저에서 동일합니다. 어떤 도움을 주셔서 감사합니다.

 var geocoder; 
    var map; 
    var marker; 

    function initialize(){ 
    //MAP 

     var latlng = new google.maps.LatLng('xxxxx','xxxxx'); 
     var options = { 
     zoom: 16, 
     center: latlng, 
     mapTypeId: google.maps.MapTypeId.SATELLITE 
     }; 

     map = new google.maps.Map(document.getElementById("map_canvas"), options); 

     //GEOCODER 
     geocoder = new google.maps.Geocoder(); 



     markerImg = google.maps.MarkerImage({ 
     url: "newIcon.png" 
     }); 

     marker = new google.maps.Marker({ 
     map: map, 
     icon: markerImg, 
     draggable: true 
     }); 



; 

    } 

    $(document).ready(function() { 

     initialize(); 

etc 

답변

5
marker = new google.maps.Marker({ 
    map: map, 
    icon: markerImg, 
    draggable: true, 
    position: latlng 
    }); 

당신은 마커에 대한 위치를 제공하지 않았다.

+0

권자, 생각하면 간단합니다. 감사. – Niklas

관련 문제