我已经gmaps4rails宝石之间的兼容性的问题,谷歌的地方APIgmaps4rails并自动完成谷歌的地方API不兼容
基本上,如果我把我的观点一个gmpas4rails这样的:
<%=gmaps%>
那么这个脚本不工作了(它normaly激活user_address领域的自动完成:
$(document).ready(initialize_gmaps_autocomplete_user_address());
function initialize_gmaps_autocomplete_user_address() {
var input = document.getElementById('user_address');
var defaultBounds = new google.maps.LatLngBounds(new google.maps.LatLng(42.71422,-4.222666), new google.maps.LatLng(51.179343,8.47412));
var autocomplete = new google.maps.places.Autocomplete(input);
autocomplete.setBounds(defaultBounds);
autocomplete.setTypes(['geocode']);
}
我试着通过gmaps4rails.call_back和陈调用脚本ge脚本中的var名称...
任何想法?
OK,我会等待下一个版本,因此,我的应用程序还没有准备好部署尚未 – alex
从GitHub上的一个是很好,如果你不能等。您甚至可以看到您的代码位于gem中捆绑的测试应用程序中:https://github.com/apneadiving/Google-Maps-for-Rails/blob/master/test/dummy/app/views/users/ index.html.erb – apneadiving
对于在我的情况1.5.6第一溶液看起来像 <%= gmaps( map_options:..., 折线:..., 脚本::无 )%> –