2011-11-23 36 views

回答

8

首先,您需要计算折线的中间/中间位置。这已经在这里讨论和回答了; https://stackoverflow.com/a/9090409/787921

然后你将不得不打开infowindow;

var infowindow = new google.maps.InfoWindow({ 
      content: "infowindow text content"}); 
infowindow.setPosition(midLatLng); 
infowindow.open(map); 
在V3的`ÌnfoWindow.position`has
+5

被改为'InfoWindow.setPosition'所以正确的代码是:'信息window.setPosition(midLatLng);'看到这里http://code.google.com/p/gmaps-API的问题/问题/细节?ID = 4733 – tommasop

相关问题