2012-12-16 2 views

답변

1

이와 유사합니다 (gLine은 전역 변수이며, gTheMap은 Google지도 개체입니다).

// draw a line connecting the points 
    var Endpoints = [marker1.position, marker2.position]; 

    if (gLine == null) 
    { 
     gLine = new google.maps.Polyline(
      { path: Endpoints, 
       strokeColor: "#FFFF00", 
       strokeOpacity: 1.0, 
       strokeWeight: 2, 
       map: gTheMap 
      }); 
    } 
    else 
     gLine.setPath(Endpoints); 

블로그 글에 대한이 here.

+0

답변을 주셔서 감사합니다 ..하지만 100 점 이상 가지고 있다면 효과가 있습니까? – brio

+0

모든 포인트를이 배열에 넣습니다. var Endpoints = [marker1.position, marker2.position, ... more points]; –

관련 문제