Google マップ V3 ポリラインがあります。ポリライン全体でクリック イベントを検出できますが、クリック イベントでさらに高度なことはできますか?
私がやりたいことは、クリックされたポリラインのセクションを検出し、これをアラートに表示することです。
routePath = new google.maps.Polyline({
path: routeCoordinates,
strokeColor: "#CC33FF",
strokeWeight: 3
});
routePath.setMap(map);
google.maps.event.addListener(routePath, 'click', function() {
alert(routePath);
// TODO: display which section of the polyline has been clicked?
});
Googleマップでこれを行う方法を知っている人はいますか?
ありがとう!