마커 상단에 infowindow를 표시하려고하는데 어려움을 겪고 있습니다. 현재클릭 핸들러에서 마커 받기 : AngularJS + Google Maps
나는 다음과 같은 HTML했다 : 해당 컨트롤러에, 나는
<map data-ng-model="mymap" zoom="4" center="[38.50, -95.00]">
<marker ng-repeat="item in list"
position="[{{item.coordinates}}]" title="{{item.name}}"
icon="./images/i.png"
on-click="onMarkerClicked(mymap, this)" />
<control name="overviewMap" opened="true" />
</map>`
그런 다음이 :
그러나$scope.onMarkerClicked = function(mymap, marker, event){
infowindow = new google.maps.InfoWindow("Hi I am the MARKER" + event.target.title);
infowindow.open(mymap, event.target);
//infowindow.open(mymap, marker);
$scope.$apply();
}
이, 내지도가 올바른 값을 가지고있다, event.target하지 않는 동안 작동되는 것처럼 보입니다 (보고 된 코드에 주석 처리 됨)
정의되지 않은 'target'속성을 읽을 수 없습니다.
마커를 사용하는 경우 정의되지 않습니다. 어떻게이 문제를 해결할 수 있습니까?
감사합니다. 게시 한 첫 번째 링크의 마지막 게시물에보고 된 두 개의 정보 창 태그 쌍을 추가했습니다. 이제 나는 정보 창을보고있다! – Manu
두 번째 링크가 작동하지 않습니다. 링크를 업데이트하십시오. –