2014-02-07 3 views
0

gmaps4rails V2 및를 사용하고 있으며 마커 위치를 검색 할 수 없습니다. 나는 그것을 반복 내지도의 범위를 벗어 마커를 삭제할gmaps4rails V2 마커 위치를 검색 할 수 없습니다.

markers = handler.addMarkers(<%=raw @hash.to_json %>); 

$.each markers, ->  
    pos = this.getPosition 
    if !bounds.contains pos 
    handler.removeMarker this 

이 내 콘솔 출력됩니다 :

Uncaught TypeError: Object #<Marker> has no method 'getPosition' 

나는 마커의 내 배열을

내가 누락 된 항목이 있습니까?

+0

()'합니까? '마커'는 마커가 아닌 것 같습니다. –

답변

0

보석으로 만든 마커는 몇 가지 방법을 만들 수있는 프록시입니다. 구글 개체에 액세스하려면

는 수행

this.getServiceObject() 

다음 :

`handler.addMarkers을 무엇
this.getServiceObject().getPosition() // mind the parenthesis! 
관련 문제