1

mapstraction-rails 플러그인을 사용하고 있으며 레일 2.3 버전에서 정상적으로 작동합니다. 나는이 오류를 받기 시작하고지도 내가 파일에서 오류를 볼 수있는 방화범mapstraction-rails와 관련된 문제 JS

TypeError: this.location.toProprietary is not a function   

options.position = this.location.toProprietary(this.api); 

를로드하지 않습니다 3.2 레일 버전을 업그레이드하는 경우 : 라인 484

에서 mxn.googlev3.core.js 레일에 사용되는 I는 함수를 호출하는 스크립트 태그에

@map.initialize_map(:onload=>false) #=> in rails 2.3 

<%= @map.initialize_map(:onload=>false).first.html_safe %> #=> in rails 3.2 as this method returns the array with one element me in it. 

방법을 사용하고 2.3 즉, 1.4

JQuery와 버전이 동일 whic h는지도를 보여줍니다.

요소를 으로 검사했습니다. this.location.toProprietary (this.api); 방화범에 그리고 "이"요소가 레일 3.2에서 다른 것 같습니다. 스크린 샷을 부탁드립니다.

에서 레일 3.2

enter image description here

답변

1

2.3

enter image description here

는 플러그인 lib 디렉토리/mapstraction/latlon.rb에있는 파일이 레일.

그것은 방법이 있습니다

def to_html 
    html =[] 
    html << "new mxn.LatLonPoint(#{@latitude},#{@longitude})" 
    return html 
end 

내가 반환 값과 수정을가 레일 2.3 버전 있다는 자바 스크립트에서 ""객체가 동일했다.

수정 방법

def to_html 
    html =[] 
    html << "new mxn.LatLonPoint(#{@latitude},#{@longitude})" 
    return html.join(" ").html_safe 
end